Answers to the questions on SO and askubuntu, along with poking through (and reading headers of) $HOME and /etc/, indicate a number of files that can be used to set environment variables, including:
~/.profile~/.bashrc~/.bash_profile~/.gnomerc~/.Rprofile/etc/bash_bashrc/etc/profile/etc/screenrc
I gather that files in /etc/ work for all users whereas files in $HOME are user-specific. I also gather that .profile is loaded at login whereas .bashrc loaded when /bin/bash is executed. I also understand that different programs have different settings files (e.g. .Rprofile for R). But I would appreciate some clarification:
- Are
*rcand*profilefiles fundamentally different? - What is the scope of such files (e.g. which files are are commonly used with Linux)
- Is there a hierarchy (e.g.
.bashrcoverwrites variables set in.settings) - What is a good reference for this class of files? For the options in these files?
INVOCATIONsection inman bash. See theFHSwiki article on Linux filesystems. That'll give you a good start and answer a couple of these questions. Files with a preceding dot (.) are typically user-specific - they reside in the user's$HOMEdirectory. – Jun 13 '12 at 20:50