有没有办法找出我的shell目前使用哪个configuration文件? 我似乎无法跟踪它,或者至less它不在任何通常的地方。 我使用的是OS X,但是我认为它在所有的UNIX系统上都是一样的。
假设它是bash我假设它使用您的主目录和/etc的正常configuration文件。 看到这个问题 ,大部分答案都指向man bash的调用部分“
When bash is invoked as an interactive login shell, or as a non-interactive shell with the --login option, it first reads and executes commands 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.
更新:
所以你正在使用zsh: man zsh节STARTUP / SHUTDOWN FILES。 基本上它会使用提到的.zsomething文件,并在$ZDOTDIR ,如果没有设置$HOME 。 总结中的文件:
$ZDOTDIR/.zshenv $ZDOTDIR/.zprofile $ZDOTDIR/.zshrc $ZDOTDIR/.zlogin $ZDOTDIR/.zlogout ${TMPPREFIX}* (default is /tmp/zsh*) /etc/zsh/zshenv /etc/zsh/zprofile /etc/zsh/zshrc /etc/zsh/zlogin /etc/zsh/zlogout
你有没有任何文件命名为zshconfiguration文件相同,但扩展名为.zwc?
那些被编译,如果更新,将被运行而不是纯文本版本。
检查手册页或使用可执行文件(或两者)上的string(1)来查找所有可能性,并查找系统中存在的可能性。 请注意,一个.profile可能会调用另一个文件,因此您可能需要检查每个文件。
检查上次访问时间; 一个configuration文件可能无法在每次启动时访问,或者如果有不同的文件存在等等,取决于(显然)完全在你的特定的shell。