Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

2 Answers 2

up vote 5 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

 
discard

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.