Quick directory switching

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.

Comments

  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.

    ReplyDelete
  2. 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.

    ReplyDelete

Post a Comment

Popular posts from this blog

Pull files off Android phone