I think at some point I messed up my .bash_profile and I have multiple now. I am trying to customize my shell but I am not sure which .bash_profile to use, if any. I thought .bashrc file was more often used?

I am running OSX - El Capitan

ls -la | more
total 480

-rw-------    1 Matthew  staff   6404 Feb 16 23:57 .bash_history
-rw-r--r--    1 Matthew  staff    719 Jan 19 20:18 .bash_profile
-rw-r--r--    1 Matthew  staff    335 Oct  7 12:35 .bash_profile.macports-saved_2017-01-19_at_20:18:05
-rw-r--r--    1 Matthew  staff    167 Jul 16  2015 .bash_profile.pysave
drwxr-xr-x  208 Matthew  staff   7072 Feb 18 19:41 .bash_sessions

No, you only have one and it's called .bash_profile. Bash will not read the ones with additional suffixes.

The other .bash_profile.* files looks like backups, possibly made by different software installations (from last year and the year before). Run a diff -u between your .bash_profile and the others (in turn) to see what's different about them if you wish, e.g.

$ diff -u .bash_profile .bash_profile.pysave

.bashrc is used by interactive shells and .bash_profile is used for login shells. If you're adding aliases, add them to .bashrc.

See also "What is the difference between ~/.profile, ~/.bashrc, ~/.bash_profile, ~/.gnomerc, /etc/bash_bashrc, /etc/screenrc ...?"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.