Command library / cd
cd
Change the current directory
Moves your shell's working directory. `cd` alone (no argument) goes home. `cd ..` goes up one level. `cd -` jumps back to whichever directory you were in before your last cd — the fastest way to bounce between two folders.
Practice cdUsage
cd [directory]
Options and flags
directorywhere to go: a path, .. (up), ~ (home), or - (previous directory)
Examples
cd /var/logJump straight to the log directory.
cd ..Up one directory level.
cd -Back to the previous directory — a quick toggle between two locations.
cd ~Straight home, from anywhere.
Common mistakes
cd.. cd ..
A space is required between the command and its argument — 'cd..' is parsed as one unknown command, not cd plus '..'.