↑↓ move Enter open Esc close

Working directory

The folder your shell is currently "standing" in.

Every process carries a current working directory, and all relative paths are resolved against it. Your shell's is what pwd prints and what cd changes.

Since each process has its own, and children inherit the parent's at launch, a script cannot change your shell's directory, and a cron job starts in the user's home rather than wherever the script file lives, which is the single most common reason scripts "work by hand but fail from cron".

See it in practice

$ pwd && (cd /tmp && pwd) && pwd

The subshell in parentheses changes its own directory and exits; your shell never moved. Inheritance flows one way only.

Where you'll meet it

Errors that come down to this concept: No such file or directory

Learn these concepts by typing them: the interactive course builds them up lesson by lesson in a real simulated shell.