Instantly Jump Up the Directory Tree

Quick Tip

Instantly Jump Up the Directory Tree

Challenge: You’re deep in a directory structure and need to quickly navigate back to the parent directory without typing out the full path.

The Solution: Use the `cd -` command.

cd -

Why it works: The hyphen (`-`) is a shell shortcut that refers to the previous working directory. Executing `cd -` swaps your current directory with the previous one, effectively moving you up one level if that was your last action.

Pro-Tip: Combine `pushd` and `popd` for managing a stack of directories you frequently visit. `pushd ` adds a directory to the stack and changes to it, while `popd` returns you to the directory at the top of the stack.

Linux Tips & Tricks | © ngelinux.com | 5/26/2026

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments