Re:Stupid Unix Tricks
by russjones on Thursday October 17, 2019 @02:07PM
(#21284783)
I ran an eBPF program called opensnoop [1] to capture what files were opened during login to a system and then re-launching bash. Looks like both are read during initial login but only .bashrc for non-login shells. Output is below.
[1] http://www.brendangregg.com/blog/2014-07-25/opensnoop-for-li...
[ Parent
| on HN ]
Be careful that some of those files explicitly include others. For example my (default) ~/.profile includes ~/.bashrc, my ~/.bash_profile includes ~/.profile, /etc/profile includes /etc/bash.bashrc...
So your capture here doesn't show only the files that bash itself decided to load. You also won't see the fallback files (e.g. bash will open .profile if .bash_profile doesn't exist).