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 *rc and *profile files 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. .bashrc overwrites variables set in .settings)
  • What is a good reference for this class of files? For the options in these files?

Linked questions

  • 3
    See the INVOCATION section in man bash. See the FHS wiki 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 $HOME directory.
    – user13742
    Commented Jun 13, 2012 at 20:50
  • 3
    All of them? Really? Commented Jun 13, 2012 at 21:30
  • @IgnacioVazquez-Abrams I am not looking for the details, just a general description of how they relate and when one should be used over the other.
    – Abe
    Commented Jun 14, 2012 at 19:12

3 Answers 3


The organization of configuration files is much less uniform than your questions seem to imply. There is no "class", there is no "hierarchy", and there is no global "configuration czar" nor committee that decrees a common syntax or other nice clean generalizations like the ones you are seeking. There is only a multitude of separate applications like R, bash, screen and the GNOME desktop environment, all of whom have their own ways of doing things, so you should look at the documentation for each individual program to answer any specific questions about a particular file. If it seems ad-hoc, that's because it is: most of Unix / Linux software out there was developed for different purposes by different people who all went about configuration slightly differently.

To answer your other questions pointwise:

  • *rc and *profile do not mean very much, so this question can't really be answered. "rc" is merely a commonly used abbreviation or suffix for configuration files. Its etymology goes back to ancient times (in computer years), and probably means run commands (from runcom). Just because applications use the same word does not mean they agree on conventions. "profile" is a much less common suffix.

  • Define "scope". Most applications do not share configuration files with other non-related applications. The one possible exception is /etc/profile and .profile, which may be used by multiple different shells (including at least sh and bash). There is something called an environment associated with every running process which can contain variables that may affect the behavior of said process. Generally, environment variables are set by the appropriate shell configuration files, or perhaps the configuration files of whatever graphical desktop environment you are using. There are also configuration files for "libraries", like .inputrc for readline and .gtkrc* for GTK, which will affect every application that uses the library.

  • No, there is no global hierarchy for configuration files. Again, refer to the documentation for the specific program in question, for example, the bash manual for bash. A general convention you can usually rely on is that user settings in $HOME override system-wide configuration in /etc. This is typically accomplished by reading the user file after the system one, so that later settings overwrite earlier ones. However, this is not a guarantee, and for definitive answers you should refer to the documentation for the specific program you are using.

  • There is no "class", at least none general enough to encompass all the files you've listed in your question, so the question of a reference for such a "class" is moot. Again, refer to the documentation of the specific program you are using.


I think this question is too broad on so many levels, e.g. you are asking questions about at least four different programs in one question. I'll only look at the difference between the configuration files in /etc and $HOME.

Unix is a multi-user operating system, this means many different persons can use a system, either by using ssh, telnet, or Xorg. To provide a standardized configuration for your users you can provide a system wide configuration in /etc/, this is typically also used by your Distribution to provide a global configuration for e.g. bash or screen.

On the other hand, some users want to customize the settings for their programs on their own like keybindings, colors or look. This is done via the configuration file in their $HOME. So in short /etc/ provides system wide configuration while the config files in $HOME allow users to change/override the system wide configuration.


Part of the answer comes from this post:

.bashrc is a shell script that Bash runs whenever it is started interactively.

Contrast .bash_profile and .profile which are only run at the start of a new login shell. (bash -l)

You choose whether a command goes in .bashrc vs .bash_profile depending on on whether you want it to run once or for every interactive shell start.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .