13

Tip #200   Pushd and Popd

Use pushd and popd to store directories to go back to later:

Blackbird:~ flsw$ pwd
/Users/flsw
Blackbird:~ flsw$ pushd tst	#current dir becomes tst 
~/tst ~
Blackbird:~/tster flsw$ pushd	#no argument moves back and forth
~ ~/tster


popd +n removes n entries from the stack without changing directory
pushd +n 'rotates' the stack so the nth directory moves to the top becoming the current directory.