Site icon New Generation Enterprise Linux

Seamlessly Jump Between Parent Directories

Quick Tip

Seamlessly Jump Between Parent Directories

Challenge: You’re deep within a directory structure and need to quickly navigate up one or more levels, but typing `cd ../../` repeatedly can be tedious.

The Solution: Use the `cd -` command to instantly switch to your previous directory.

cd -

Why it works: The shell maintains a directory stack. `cd -` specifically refers to the last directory you were in, effectively allowing you to toggle between two locations with a single command.

Pro-Tip: For more advanced directory stack manipulation, explore `pushd` and `popd`. `pushd` adds a directory to the stack and changes to it, while `popd` removes a directory from the stack and changes to it.

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

0 0 votes
Article Rating
Exit mobile version