Do you want BuboFlash to help you learning these things? Or do you want to add or correct something? Click here to log in or create user.



Question
In linux, what is the key difference between bash initialization scripts /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile VS ~/.bashrc?
Answer

/etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile are run only after initial login (i.e. only first login shell runs them), where as ~/.bashrc is run after every new shell is invoked.

^^Therefore ~.bashrc is better place to put things like aliases, while ~/.profile is better for env variables


Question
In linux, what is the key difference between bash initialization scripts /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile VS ~/.bashrc?
Answer
?

Question
In linux, what is the key difference between bash initialization scripts /etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile VS ~/.bashrc?
Answer

/etc/profile, ~/.bash_profile, ~/.bash_login, ~/.profile are run only after initial login (i.e. only first login shell runs them), where as ~/.bashrc is run after every new shell is invoked.

^^Therefore ~.bashrc is better place to put things like aliases, while ~/.profile is better for env variables

If you want to change selection, open document below and click on "Move attachment"

20. Advanced Shell Scripting
mmand name, which indicates to the shell that it is a login shell, meaning that it reads and execute several scripts to initialize the environment. In the case of bash , the files it reads are: <span>/etc/profile , ~/.bash_profile , ~/.bash_login and ~/.profile , in that order. In addition, an interactive shell that is not a login shell also reads ~/.bashrc . Note that traditional sh shells only read /etc/profile and ~/.profile . 20.8.1 Custom

Summary

statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

Details

No repetitions


Discussion

Do you want to join discussion? Click here to log in or create user.