Appearance
Essential Commands
Navigation
| Command | What It Does | Example |
|---|---|---|
pwd | Print current directory | pwd → /Users/fabiocorrea |
ls | List files in current directory | ls |
ls -la | List all files with details (including hidden) | ls -la |
cd | Change directory | cd Documents |
cd .. | Go up one directory | cd .. |
cd ~ | Go to home directory | cd ~ |
cd - | Go to previous directory | cd - |
Files and Folders
| Command | What It Does | Example |
|---|---|---|
mkdir | Create a directory | mkdir my-project |
touch | Create an empty file | touch notes.txt |
cp | Copy a file | cp notes.txt backup.txt |
cp -r | Copy a directory | cp -r project project-backup |
mv | Move or rename | mv old.txt new.txt |
rm | Delete a file | rm unwanted.txt |
rm -r | Delete a directory | rm -r old-folder |
cat | Display file contents | cat notes.txt |
open | Open file with default app | open photo.jpg |
open . | Open current folder in Finder | open . |
Warning:
rmdeletes permanently: files don't go to the Trash. Be careful withrm -r.
Searching
| Command | What It Does | Example |
|---|---|---|
find | Find files by name | find ~/Documents -name "*.pdf" |
grep | Search inside files | grep "password" config.txt |
System
| Command | What It Does | Example |
|---|---|---|
whoami | Show current username | whoami |
date | Show current date/time | date |
uptime | How long Mac has been running | uptime |
df -h | Show disk space | df -h |
top | Live system monitor (press q to quit) | top |
clear | Clear the terminal screen | clear |