将以下内容添加到您的~/.bashrc for x in $HOME/.bashrc.d/* ; do test -f "$x" || continue test -x "$x" || continue source "$x" done 或者到你的~/.config/fish/config.fish for x in $HOME/.fish.d/*.fish source "$x" end