The everyday commands
Here are the commands you'll see constantly. Read them like sentences: a verb, sometimes followed by a target.
pwd # "print working directory" — where am I right now?
ls # list the files and folders here
ls -la # list everything, including hidden files, with details
cd projects # change directory — move into the "projects" folder
cd .. # move up one folder (".." means "the folder above")
cd ~ # go back to your home folder
mkdir my-app # make a new folder called "my-app"
cp notes.txt backup.txt # copy a file (original stays, copy is made)
mv old.txt new.txt # move or rename a file
rm draft.txt # remove (delete) a file
A few notes that save real grief:
Your files live in a tree of nested folders, and cd is how you walk it. Here's a small one, with pwd showing where you'd be standing if you cd'd into my-app:
/ ← the top ("root")
└── Users/
└── mini/ ← your home folder (the ~ shortcut)
└── projects/
├── my-app/ ← cd here → pwd shows /Users/mini/projects/my-app
│ ├── src/
│ └── notes.txt
└── old-app/
cdis how you move around. Combined withpwdandls, it's 80% of what you'll ever do. You move into the right folder, look around, then run something.- Paths can be relative or absolute.
cd projectsis relative to where you are;cd /Users/mini/projectsis the full address from the top. rmis permanent. There is no Recycle Bin or Trash on the command line. When yourma file, it's gone — no "are you sure?", no undo. Be especially careful withrm -rf, which deletes a folder and everything inside it without asking. If you're ever unsure what armcommand will delete, don't run it. Ask the AI to explain it first.