What you'll build
You'll learn the basic terminal commands that every developer needs. You'll navigate between folders, create and edit files, and run programs from the command line. These are the foundational skills you'll use every day as a programmer. By the end, you'll have lost your fear of the black screen and gained confidence using the terminal.
Step 1: Open the terminal
| System | How to open |
|---|---|
| macOS | Cmd + Space โ type "Terminal" |
| Windows | Win + X โ "Terminal" or "PowerShell" |
| Linux | Ctrl + Alt + T |
Step 2: Your first command
Type this and press Enter:
echo "Hello World"
You should see:
Hello World
That's it. You ran a command.
Essential commands
| Command | What it does | Example |
|---|---|---|
pwd | Shows where you are | pwd โ /Users/your-name |
ls | Lists files | ls โ Documents Downloads ... |
cd | Changes folder | cd Documents |
mkdir | Creates folder | mkdir my-project |
touch | Creates empty file | touch hello.txt |
cat | Shows content | cat hello.txt |
clear | Clears screen | clear |
Practice: Create your first folder
# Create a folder
mkdir my-first-project
# Enter the folder
cd my-first-project
# Create a file
echo "Hello from the terminal!" > greeting.txt
# See the content
cat greeting.txt
Folder navigation
| Command | What it does |
|---|---|
cd folder | Enter folder |
cd .. | Go up one level |
cd ~ | Go to your home |
cd - | Go to previous |
If something failed
| Error | Cause | Solution |
|---|---|---|
command not found | Misspelled command | Check spelling |
No such file or directory | Folder doesn't exist | Use ls to see what's there |
Permission denied | No permissions | Use sudo (carefully) |
Tips
- Use Tab to autocomplete names
- Use up arrow to repeat previous commands
- Use Ctrl+C to cancel a command
What did you learn?
The terminal isn't magic. They're text commands:
- You type a command
- You press Enter
- You see the result
Next step
โ My First Repository โ Save your code with Git