Jan 232010
Using system directory stack with pushd & popd
Answer:
When you need to changes a lot of directory frequently, pushd & popd can be very useful
E.g.
john@localhost:/tmp $ pushd /home/jack/
# change to /home/jack/ and push to the stack
/home/jack /tmp
john@localhost:/home/jack $ pushd /home/mark/
# change to /home/mark/ and push to the stack
/home/mark /home/jack /tmp
john@localhost:/home/mark $ popd
# pop current directory and change to /home/jack
/home/jack /tmp
john@localhost:/home/jack $ popd
# pop current directory and change to /tmp
john@localhost:/tmp/ $