Site icon Dipin Krishna

Use “cd -” to toggle between the last two directories

You can toggle between the last two current directories using cd – as shown
below.

[dipin@linuxgeek ~]$ cd /etc/
[dipin@linuxgeek etc]$ pwd
/etc
[dipin@linuxgeek etc]$ cd /var/
[dipin@linuxgeek var]$ pwd
/var
[dipin@linuxgeek var]$ cd -
/etc
[dipin@linuxgeek etc]$ pwd
/etc
[dipin@linuxgeek etc]$

Enjoy!

Exit mobile version