pushd
Add the current directory to the directory stack.
pushd ~/tmp
Add ~/tmp directory to the stack and cd there.
dirs -v
Display the directory stack.
pushd +2
Bring the directory at the 2 position to the front of the stack (0) and cd there.
popd
Pop off (remove from stack) the top/current directory in the stack (position 0).
popd -1
Remove the directory at the 1 position in the stack.
Or you could just use Poor man's recall:
cd -
Recalls the last directory. Just like the recall button on your TV remote.
Add your comment