In CentOS release 5.8 (Final), where is the bash system profile?

Is it /etc/profile ?

I've added the following to source my ~/.bashrc file but haven't had any luck as it fails. I know it fails because I've changed the $PS1.

I also think it may be caused because I have WHM setup.


The best place to put your own system-wide-scripts is at /etc/profile.d they need an ".sh" suffix to work. Look at /etc/profile and /etc/bashrc. Both scripts source these scripts.


Define system environment variables in /etc/profile. This file, like ~/.profile (or ~/.bash_profile if your login shell is bash), is read when you log in (on some systems, this excludes graphical logins), at the very start of your session.

Define system bash configurations in /etc/bash.bashrc or /etc/bashrc (the path depends on the distribution, I don't know which one CentOS uses). This file is read every time you start an interactive shell. If you define environment variables there, they won't be available in programs that aren't started from a shell, but they'll override environment variables set by the caller. Do not define environment variables in /etc/bashrc or ~/.bashrc.

See Is there a ".bashrc" equivalent file read by all shells? and the posts it cites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.