When bash is invoked as an interactive login shell, or as a non-inter‐
active shell with the --login option, it first reads and executes com‐
mands from the file /etc/profile, if that file exists. After reading
that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile,
in that order, and reads and executes commands from the first one that
exists and is readable. The --noprofile option may be used when the
shell is started to inhibit this behavior.
是的 -
/etc/skel
在创建帐户期间复制的默认文件adduser
是:如您所见,有一个 default
.bash_logout
但没有 default.bash_profile
。是的,这很好-请注意,如果您这样做,它将优先于
~/.profile
文件读取-来自以下INVOCATION
部分man bash
:因此,您可能希望
~/.profile
从新版本~/.bash_profile
中获取资源,以维护它提供的任何功能。