We can use cd -
to access the most recently accessed folder, but what if I want to quickly switch to the last but one folder accessed?
Advertisement
Answer
Sure there’s a way!
You want the shell builtin pushd
.
JavaScript
x
[~]$ pwd
/home/dan
[~]$ pushd /tmp
/tmp ~
[tmp]$ pushd /usr/bin
/usr/bin /tmp ~
[bin]$ pushd +2
~ /usr/bin /tmp
[~]$