Diff between /etc/profile and ~/bash_profile
Hi guys,
I am new to linux and despite of searching alot on google still confused about following basic concepts,
1. What is the difference between /etc/.profile and ~/bash_profile? If i make changes in /etc/profile, it will be implemented system wide for all users and all shells but changes in ~/bash_profile will be specific to that specific user only, is this correct?
2. If changes are made in ~/bash_profile of a user but default shell of user is not bash then nothing will happen, correct? In other words changes in ~/bash_profile will only affect bash shell of that specific user.
3. Suppose i have a script (/tmp/abc) and i want this script to run each time a specific user login, should i add following line in his ~/bash_profile,
sh /tmp/abc
but again if the default shell of that user is not bash, then nothin will happen, right?
4. For same script (/tmp/abc), i want it to run each time any user login, should i add following line in /etc/profile,
sh /tmp/abc
is this correct?
5. What is the difference between ~/.bashrc and ~/.bash_profile?
6. For achieving point 4, can i proceed like this. Add this script to rc(x).d directory of default runlevel?
I will be really thankful to anyone who can help me with these points and this thread will certainly help alot of newbies like me.
Thanks
|