Quick Tip
Seamlessly Navigate Directory History with `cd -`
Challenge: You’re working deep within a directory structure, and need to quickly switch back to the *previous* directory you were in, without having to retype the full path or use complex navigation commands.
The Solution: Use the `cd -` command.
cd -
Why it works: The shell keeps track of your current and previous working directories. `cd -` toggles between these two directories, allowing for rapid back-and-forth navigation.
Pro-Tip: For managing multiple directory locations in a stack, use `pushd` to add a directory and `popd` to return to the previous one.
Linux Tips & Tricks | © ngelinux.com | 5/26/2026
