$cdpath
–
Directories Used by cd
$cdpath contains the directories used as a search path by the cd builtin command.
The linked scalar variable $CDPATH contains the same value as a colon-separated string and
is updated at the same time when $cdpath is modified.
Links
Examples
- Update
$cdpathand 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!