$CDPATH
–
Directories Used by cd
$CDPATH is a colon-separated list of directories used as a search path for the cd builtin command.
The linked array variable $cdpath is updated at the same time when $CDPATH is modified.
Links
Examples
- Update $CDPATH and evaluate the linked $cdpath
- Output:
1 2 3CDPATH=".:$HOME:/opt" echo "$cdpath" echo "$CDPATH"1 2. /home/user /opt .:/home/user:/opt - Make
cdalways look into$HOMEwhen the directory wasn’t found in the current directory 1CDPATH=".:$HOME"
BashSupport Pro is a Zsh IDE with support for $CDPATH – try it now!