$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.

Examples

Update $CDPATH and evaluate the linked $cdpath
1
2
3
CDPATH=".:$HOME:/opt"
echo "$cdpath"
echo "$CDPATH"
Output:
1
2
. /home/user /opt
.:/home/user:/opt
Make cd always look into $HOME when the directory wasn’t found in the current directory
1
CDPATH=".:$HOME"
BashSupport Pro 是一款支持 CDPATH** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款