Terminal Basics
The terminal is how you talk directly to your computer. No clicking, no menus—just you typing commands and your computer responding. It sounds intimidating, but you only need about 10 commands to get started.
What is a Terminal?
Think of the terminal as texting your computer. Instead of clicking buttons, you type short commands. Your computer reads them and does exactly what you asked.
Every developer uses it. Git, npm, deployment tools—they all run in the terminal. Once you know the basics, you'll wonder why you ever avoided it.
The Vibe Coder Reality
Claude Code runs in the terminal. When you open it, you're already in the terminal. You don't need to be an expert—Claude handles the heavy lifting. But knowing a few basics helps you navigate when Claude asks "which folder?"
Opening the Terminal
🍎 Mac
Press Cmd + Space, type "Terminal", hit Enter.
Or use iTerm2 for a better experience.
🪟 Windows
Press Win + R, type "cmd" or "powershell".
Or use Windows Terminal from the Microsoft Store (recommended).
VS Code Tip
Press Ctrl + ` (backtick) to open the integrated terminal. Most developers live here.
Commands You'll Actually Use
pwd — Where am I?
Print Working Directory. Shows the full path to your current folder. Use this when you're lost.
$ pwd
/Users/yourname/projects/my-app
ls — What's here?
List. Shows all files and folders in your current directory. Add -la to see hidden files and details.
$ ls
node_modules package.json src README.md
$ ls -la
.env.local .git .gitignore node_modules ...
Windows Note
On Windows CMD, use dir instead of ls. PowerShell supports both.
cd — Move around
Change Directory. Navigate into folders. Use .. to go up one level.
# Go into a folder
cd my-project
# Go up one level
cd ..
# Go to home directory
cd ~
# Go to a specific path
cd /Users/yourname/Desktop
mkdir — Create a folder
Make Directory. Creates a new folder.
# Create a new folder
mkdir my-new-project
# Create nested folders
mkdir -p src/components/ui
touch & rm — Create and delete
touch creates empty files. rm deletes them. Be careful with rm—there's no trash can!
# Create a new file
touch index.js
# Delete a file
rm old-file.js
# Delete a folder and everything in it
rm -rf folder-name # DANGEROUS!
Warning
rm -rf deletes forever. No confirmation, no recovery. Double-check before running.
clear — Clean slate
Clears the terminal screen. Doesn't delete anything—just tidies up.
clear
# Or press Ctrl + L (same thing)
Keyboard Shortcuts That Save Time
| Shortcut | What it does |
|---|---|
| Tab | Auto-complete file/folder names |
| ↑ / ↓ | Cycle through command history |
| Ctrl + C | Cancel current command |
| Ctrl + L | Clear the screen |
| Ctrl + A | Jump to start of line |
| Ctrl + E | Jump to end of line |
| Ctrl + R | Search command history |
Tab is Your Best Friend
Start typing a folder name and press Tab—the terminal auto-completes it. No more typos!
Quick Reference
| Command | What it does |
|---|---|
| pwd | Print current directory |
| ls | List files |
| ls -la | List all files with details |
| cd folder | Go into folder |
| cd .. | Go up one level |
| mkdir name | Create folder |
| touch file | Create empty file |
| rm file | Delete file |
| clear | Clear screen |
| code . | Open VS Code here |
Common Pitfalls
"Command not found"
Usually means the program isn't installed, or you're in the wrong directory.
Fix: Check spelling. Make sure you've installed the tool (npm, git, etc.). Try running which command-name to see if it exists.
"Permission denied"
You're trying to do something that requires admin access.
Fix: Add sudo before the command (Mac/Linux). Be careful—sudo gives full access. On Windows, run as Administrator.
"I'm in the wrong folder"
Commands only work in the right context. Running npm install outside your project folder won't work.
Fix: Run pwd to see where you are. Use cd to navigate to your project folder.
"The command is stuck"
Some commands (like servers) run forever until you stop them.
Fix: Press Ctrl + C to cancel and get your prompt back.
Ready for version control?
Now that you can navigate the terminal, learn Git to track your changes.
Git & GitHub Guide →