Instantly Jump to Parent Directories with `cd -`

Quick Tip

Instantly Jump to Parent Directories with `cd -`

Challenge: You’re deep within a directory structure and need to quickly return to the previous directory you were in, without having to type out the full path.

The Solution: Use the `cd -` command.

cd -

Why it works: The shell maintains a special variable, `OLDPWD`, which stores the path of your previous directory. `cd -` is a shortcut that tells the shell to change to the directory stored in `OLDPWD`.

Pro-Tip: For managing multiple directory “bookmarks” and quickly jumping between them, explore commands like `pushd` and `popd`.

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

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments