Shell – Equivalent of forward/back buttons for unix shell (when navigating directories)

command linedirectoryshell

I'd like to be able to type in terminal commands of forward/back especially if I went from a directory with a super-long name to home (and want to return back to the directory with the super-long name).

Best Answer

pushd and popd can be very useful. For example try


$ pushd somedir

and when you are done, just do


$ popd

and you are back where you started.

The best part is you can do


$ pushd somedir

$ pushd anotherdir

$ pushd onemoredir

and then you can "step back" one at a time using popd.

Good luck!

Related Question