Moving around
Three tiny commands, `pwd`, `ls` and `cd`, get you anywhere.
Your files live in a tree of folders. At any moment the terminal is "standing" in one folder, called the working directory. These three commands are your map and compass.
pwd: print working directory. Where am I?ls: list what's in this folder.cd folder: change directory. Walk into a folder.
Handy shortcuts
cd ..goes up one folder.cd ~(or justcd) goes to your home folder.cd -jumps back to where you just were.
Paths can be absolute (start at the root, like /Users/sam/projects) or relative (start from where you are, like projects/site). Relative paths are shorter, so you'll use them most.
Quick check
You are in ~/projects/site and run cd ... Where do you end up?
- ~
- ~/projects
- ~/projects/site/..
- Nowhere, it errors
Answer: ~/projects. .. always means the parent folder, so you step up from site to projects.