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

Answers to the inquiries on SO and also askubuntu, in addition to jabbing via (and also reviewing headers of) $HOME and also /etc/, show a variety of documents that can be made use of to set environment variables, consisting of:

  • ~/.profile
  • ~/.bashrc
  • ~/.bash_profile
  • ~/.gnomerc
  • ~/.Rprofile
  • /etc/bash_bashrc
  • /etc/profile
  • /etc/screenrc

I collect that documents in /etc/ benefit all customers whereas documents in $HOME are customer - details. I additionally collect that .profile is filled at login whereas .bashrc filled when /bin/bash is implemented. I additionally recognize that various programs have various settings documents (as an example .Rprofile for R). Yet I would certainly value some explanation:

  • Are *rc and also *profile documents basically various?
  • What is the extent of such documents (as an example which documents are are generally made use of with Linux)
  • Is there a power structure (as an example .bashrc overwrites variables embeded in .settings)
  • What is an excellent reference for this class of documents? For the alternatives in these documents?

Connected inquiries

75
2022-06-07 14:38:25
Source Share
Answers: 2

The company of arrangement documents is a lot less consistent than your inquiries appear to indicate. There is no "class", there is no "hierarchy", and also there is no international "configuration czar" neither board that decides an usual syntax or various other wonderful tidy generalizations like the ones you are looking for. There is just a plethora of different applications like R, bash, screen and also the GNOME desktop computer setting, every one of whom have their very own means of doing points, so you need to consider the documents for each and every specific program to address any kind of details inquiries concerning a certain documents. If it appears advertisement - hoc, that is due to the fact that it is: a lot of Unix / Linux software program around was created for various objectives by various individuals that all dealt with arrangement a little in different ways.

To address your various other inquiries pointwise:

  • *rc and also *profile do not suggest significantly, so this inquiry can not actually be addressed. "rc" is just a generally made use of acronym or suffix for arrangement documents. Its etymology returns to old times (in computer system years), and also possibly suggests run commands (from runcom). Even if applications make use of the very same word does not suggest they settle on conventions. "profile" is a much less usual suffix.

  • Specify "scope". The majority of applications do not share arrangement documents with various other non - relevant applications. The one feasible exemption is /etc/profile and also .profile, which might be made use of by numerous various coverings (consisting of at the very least sh and also bash). There is something called an environment related to every running procedure which can have variables that might influence the actions of claimed procedure. Usually, environment variables are set by the ideal shell arrangement documents, or probably the arrangement documents of whatever visual desktop computer setting you are making use of. There are additionally arrangement apply for "libraries", like .inputrc for readline and also .gtkrc* for GTK, which will certainly influence every application that makes use of the collection.

  • No, there is no international power structure for arrangement documents. Once more, describe the documents for the details program concerned, as an example, the bash for bash. A basic convention you can generally rely upon is that customer settings in $HOME override system - vast arrangement in /etc. This is commonly completed by reviewing the customer documents after the system one, to make sure that later settings overwrite earlier ones. Nonetheless, this is not a warranty, and also for clear-cut solutions you need to describe the documents for the details program you are making use of.

  • There is no "class", at the very least none basic adequate to incorporate all the documents you've detailed in your inquiry, so the inquiry of a reference for such a "class" is moot. Once more, describe the documents of the details program you are making use of.

53
2022-06-07 15:06:03
Source

I assume this inquiry is also wide on numerous degrees, as an example you are asking inquiries around at the very least 4 various programs in one inquiry. I'll just consider the distinction in between the arrangement documents in /etc and also $HOME.

Unix is a multi - customer os, this suggests several individuals can make use of a system, either by utilizing ssh, telnet, or Xorg. To give a standard arrangement for your customers you can give a system vast arrangement in /etc/, this is commonly additionally made use of by your Distribution to give an international arrangement for as an example bash or screen.

On the various other hand, some customers intend to tailor the settings for their programs by themselves like keybindings, shades or look. This is done using the arrangement documents in their $HOME. So basically /etc/ gives system vast arrangement while the config documents in $HOME permit customers to change/override the system vast arrangement.

6
2022-06-07 15:04:30
Source