LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (http://www.linuxquestions.org/questions/general-10/)
-   -   What is the global counterpart of ~/.bashrc? (http://www.linuxquestions.org/questions/general-10/what-is-the-global-counterpart-of-%7E-bashrc-4175443559/)

stf92 12-31-2012 05:19 AM

What is the global counterpart of ~/.bashrc?
 
Hi:

~/.bashrc gets things done for a user. Is there a bashrc (or some other name) in /etc that does the same as ~/.bashrc but globally?

EDIT: I think it is /etc/profile.

kabamaru 12-31-2012 06:37 AM

/etc/bashrc

http://www.linuxfromscratch.org/blfs...s/profile.html

stf92 12-31-2012 06:40 AM

Thanks. However in bash's man page, under FILES, it does not mention it.

kabamaru 12-31-2012 07:29 AM

Yes, that's because it's not built into Bash. It's just a convention that is widely used; some distros put an /etc/bashrc file for system-wide settings, and they source it from ~/.bashrc with:

Code:

if [ -f /etc/bashrc ]; then
  . /etc/bashrc
fi


stf92 12-31-2012 01:37 PM

Thank you very much.


All times are GMT -5. The time now is 06:52 AM.