Home > shell tips > zsh wonderful use of dirs,popd,pushp, cd ~5

zsh wonderful use of dirs,popd,pushp, cd ~5

February 20th, 2010 Leave a comment Go to comments

I’ve never got the hang of popd & pushd they seemed a bit pointless. zsh however has extended their abilities eg:-

> dirs -v    # number and list your recent directories one per line

> cd ~5     # cd to directory 5 in the directory stack

> cd -<tab>    # the tab complete lists the directory stack then type a digit to select the one you require (saves you having to do a dirs -v in the first place

I have to work in very complicated directory structures so this will be fantastically useful.

#don’t forget the zsh cd substitute command

> cd olddir newdir

eg you are in

/inetpub/wwwroot/www.livesite.co.uk/products/

> cd live test

/inetpub/wwwroot/www.testsite.co.uk/products/

Categories: shell tips Tags:
  1. No comments yet.
  1. No trackbacks yet.