shell

Return to Previous Directory in Bash

This article introduces a command you can use when you want to return to the directory you were in before cd in the Linux Bash command line.

Shou Arisaka
1 min read
Nov 19, 2025

This article introduces a command you can use when you want to return to the directory you were in before cd in the Linux Bash command line.

cd -

It’s simple.

If you do cd - again, it doesn’t go to the directory before that… instead, it returns to the directory you cd -‘d to.

Reference

Share this article

Shou Arisaka Nov 19, 2025

🔗 Copy Links