Is there a way to find out which profile my shell is currently using? I can't seem to track it down, or at least it's not in any of the usual places. I'm using OS X, but I assume that it would be the same on all UNIX systems.
Asuming it is bash I assume it using the normal profile files in your home directory and the /etc. See this question which answer mostly points to the invocation section of 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.
Update:
So you are using zsh:
man zsh section STARTUP/SHUTDOWN FILES. Basically it will use the .zsomething files that are mentioned and look in $ZDOTDIR , if that is not set than $HOME. The files in summary:
Check the man page or use strings(1) on the executable (or both) to look for all the possibilities, and look for the ones that exist on your system. Note that one .profile may call another file, so you might have to inspect each of the files.
Check the last access time also; a profile file may not be accessed on every startup, or if a different file exists, etc. Depends (obviously) completely on your particular shell.
Asuming it is bash I assume it using the normal profile files in your home directory and the
/etc
. See this question which answer mostly points to the invocation section ofman bash
"Update:
So you are using zsh:
man zsh
section STARTUP/SHUTDOWN FILES. Basically it will use the.zsomething
files that are mentioned and look in$ZDOTDIR
, if that is not set than$HOME
. The files in summary:Do you have any files named the same as a zsh profile file but with a .zwc extension?
Those are compiled and, if newer, will be run instead of the plain text version.
Check the man page or use strings(1) on the executable (or both) to look for all the possibilities, and look for the ones that exist on your system. Note that one .profile may call another file, so you might have to inspect each of the files.
Check the last access time also; a profile file may not be accessed on every startup, or if a different file exists, etc. Depends (obviously) completely on your particular shell.