Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 9 down vote accepted

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.

share|improve this answer

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 Alternative to .bashrc and the posts it cites.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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