Navigation
Bash · Reference cheat sheet
Navigation
Bash · Reference cheat sheet
📋 Overview
Navigation means moving around the filesystem from the terminal: knowing where you are, listing contents, and changing directories. These commands are the foundation of everyday shell use.
🔧 Core concepts
| Command | Purpose |
|---|---|
pwd | Print working directory |
ls | List files and folders |
cd | Change directory |
~ | Home directory |
. / .. | Current / parent directory |
/ | Root of the filesystem (Unix) |
Paths can be absolute (/home/sam/docs) or relative (./src, ../other).
💡 Examples
Orient yourself:
pwd
ls
ls -laMove around:
cd ~
pwd
cd /tmp
pwd
cd -
pwd # back to previous directoryRelative paths:
mkdir -p practice/sub
cd practice
pwd
cd sub
pwd
cd ..
lsUseful shortcuts:
cd # goes to $HOME
cd ~/Downloads
ls -lh # human-readable sizes⚠️ Pitfalls
cdinto a file fails;cdneeds a directory.- Unquoted spaces:
cd My Projects→cd "My Projects". lsoutput alone does not show hidden files — usels -a.- On Windows Git Bash,
C:appears under/c/— not asC:\.