cd - change the working directory
cd [dir]
Examples
$ cdgo home
$ cd -go back to the previous directory
$ cd ..up one level
Gotchas
- cd is a shell builtin - it has to be, since a child process could not change YOUR directory.
- In a script always write
cd /some/dir || exit 1. shellcheck SC2164.
Taught in
- 0.5 Saturation and the USE method
- 0.17 Budget arithmetic: minutes, requests, burn rate, time left
- 0.29 Running an incident: severity, roles, comms, and the clock
- 0.31 Writing the postmortem: evidence, timeline, blameless language
- 0.35 Measuring toil, and choosing what to remove first
- 1.3 The tree
- 1.7 Driving the shell: exit codes, chaining, redirection
- 4.5 Permission bits and octal
Try cd in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.