Site icon New Generation Enterprise Linux

Effortless Directory Hopping with `cd -`

Quick Tip

Effortless Directory Hopping with `cd -`

Challenge: Frequently navigating back to your previous directory can be tedious if you have to retype or remember the full path.

The Solution: Use the `cd -` command to instantly jump back to your most recently visited directory.

cd -

Why it works: The shell keeps track of your current and previous working directories. `cd -` is a shorthand to recall and switch to that previous directory.

Pro-Tip: Combine `cd -` with `pushd` and `popd` for managing a stack of directories you frequently switch between.

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

0 0 votes
Article Rating
Exit mobile version