Bash tip: $CDPATH

I heard about bash’s $CDPATH recently and it is an awesome productivity tip. Enjoy!

2 Responses to “Bash tip: $CDPATH”

  1. 1 dino99 September 23, 2008 at 12:11 pm

    thanks for these very interesting bash tips.
    I’ve tried to use HISTIGNORE to have better and more clever history (removing all those duplicates), but no chance: seem to not apply !!!

    Please post your comments if you succeed

  2. 2 Andy September 24, 2008 at 1:04 pm

    I’m not much of a shell connoisseur, but a while back a friend switched me from bash to zsh with the justification “it is the same as bash, except better”.

    I’m not sure how true that is, but its tab completion is better than bashes:

    you type: “cat /u/s/d/w” and press tab and it will expand to “cat /usr/share/d/w” and put your cursor after the “d”, press “i” and tab again, and it will expand from “cat /usr/share/di/w” to “cat /usr/share/dict/words”. Very handy.

    And yes, CDPATH works in it (as do most bashisms I think). You can also set autocd, which will cd in to a directory if you type its name. I don’t like it, but some people do.

Comments are currently closed.

%d bloggers like this: