Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

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/ $

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>