Coredump

Work, play, and everything in-between.

Quick directory switching

with 3 comments

At work, I do a lot of directory traversal: going from one location to another within the whole (global) filesystem structure. So, to conveniently go back to a previous directory, I use pushd and popd, aside from the usual cd:

$ pwd
/home/iandexter
$ pushd /etc/sysconfig
$ pwd
/etc/sysconfig
$ popd
$ pwd
/home/iandexter

You can even echo $DIRSTACK to list the current directories in the stack, and push multiple directories.

Read more:

Written by Ian Dexter

August 17th, 2007 at 2:07 am

Posted in Play, Work

Tagged with , , , , , ,

3 Responses to 'Quick directory switching'

Subscribe to comments with RSS or TrackBack to 'Quick directory switching'.

  1. If you’re familiar with FRIENDS, a line was said in one episode, that goes something like: “I know you’re talking but all I hear is BLAH BLAH BLAH…” Hee. Have a fine weekend. God Bless.

    Vikkicar

    17 Aug 07 at 20:55

  2. how about cd -

    brainbox

    12 Sep 07 at 18:58

  3. Thanks, brainbox.

    But `cd -` works on a single level only. `pushd` and `popd` are bash only, though — not available in ksh. Then again, I’m almost always into bash.

    Ian Dexter

    16 Sep 07 at 9:10

Leave a Reply