在 CentOS/RHEL 6.x(及更高版本)和 Fedora 20(及更高版本)上:
当您登录时,$HOME/.bash_profile将执行该脚本并将该脚本添加$HOME/bin到您的路径中。
在Ubuntu上:
当您登录时,$HOME/.profile将执行该脚本并将该脚本添加$HOME/bin到您的路径中。(来源:https ://askubuntu.com/questions/49784/how-is-bin-add-to-my-path )
在更改之前,这存在于/etc/skel/.profile所有用户中,因此也存在于所有用户中~/.profile。
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
Run Code Online (Sandbox Code Playgroud)
Debian 6 如此,Ubuntu 或许还有其他。