Learning the command line on Mac is easier than it looks. You don't need to memorize hundreds of commands. Start with a few essentials and build from there.
Open Terminal First
Press Command + Space, type "Terminal", press Enter.
You'll see something like:
yourname@mac ~ %
This is the prompt. It's waiting for your command.
Commands to Learn First
Start with these. They handle most daily tasks:
Navigation
| Command | What it does | Example |
|---|---|---|
pwd |
Show current location | pwd |
ls |
List files | ls |
cd |
Change directory | cd Documents |
File Operations
| Command | What it does | Example |
|---|---|---|
mkdir |
Create folder | mkdir projects |
touch |
Create file | touch notes.txt |
cp |
Copy | cp file.txt backup.txt |
mv |
Move/rename | mv old.txt new.txt |
rm |
Delete | rm file.txt |
Viewing Files
| Command | What it does | Example |
|---|---|---|
cat |
Show file contents | cat readme.txt |
less |
Browse long files | less bigfile.txt |
head |
First 10 lines | head log.txt |
tail |
Last 10 lines | tail log.txt |
That's about a dozen commands. With these, you can do real work.
Learn By Doing
Don't try to memorize everything first. Instead:
- Open Terminal
- Try a command
- See what happens
- Repeat
Terminal won't break your computer with basic commands. Experiment freely.
Practical Exercises
Exercise 1: Navigate
pwd # Where am I?
ls # What's here?
cd Desktop # Go to Desktop
ls # What's on my Desktop?
cd .. # Go back up
Exercise 2: Create Files
mkdir test-folder # Create a folder
cd test-folder # Enter it
touch file1.txt # Create a file
touch file2.txt # Create another
ls # See your files
Exercise 3: View and Copy
echo "Hello" > file1.txt # Put text in file
cat file1.txt # View it
cp file1.txt file3.txt # Copy it
ls # See the copy
Common Beginner Mistakes
1. Forgetting where you are
Always use pwd when confused. It shows your location.
2. Spaces in paths
Wrong:
cd My Documents
Right:
cd "My Documents"
cd My\ Documents
3. Running unknown commands
Don't copy commands from the internet without understanding them. Especially anything with sudo rm.
Resources for Learning
Free Course
Mac Terminal for Humans - A free, practical course that teaches what you actually need.
Built-in Help
Every command has a manual:
man ls # Manual for ls
man cp # Manual for cp
Press q to exit.
Or quick help:
ls --help
Practice
The best teacher. Use Terminal daily:
- Navigate with
cdinstead of Finder - Create folders with
mkdir - Check files with
catandls
How Long Does It Take?
- Day 1: Basic navigation and file operations
- Week 1: Comfortable with daily tasks
- Month 1: Using it for real work
- Ongoing: Always learning new tricks
You don't need months to be useful. A few hours gets you the basics.
What to Learn Next
After the basics:
- grep - Search file contents
- find - Search for files
- Pipes - Chain commands together
- Aliases - Create shortcuts
But don't rush. Master the basics first.
The Key Insight
You don't need to know every command. You need to know:
- A few essential commands
- How to look up what you don't know
- Practice
That's it. Start with the basics, use them regularly, and expand as needed.
Start Learning
A free course teaches you what you need to know, in the right order.
Check it out at Mac Terminal for Humans.