Server Fault is a question and answer site for system and network administrators. 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

I have a system wide install of a software . The source is located at /opt/Software . There is a bashrc file of the Software which is needed to be sourced for every user using it . Will the addition of

to their ~/.bashrc work for all users ? How should I set the permissions for the file at $PATH_TO_SOFTWARE_BASHRC so that all the users can access the software ?

share|improve this question

Just put that code in /etc/bashrc and every user will have it.
If there will be some permission issues, use chown/chmod to fix that.

share|improve this answer
I find no reference to /etc/bashrc in the Bash documentation. – Dennis Williamson Jul 29 '10 at 14:33
There is the reference, check the --rcfile description. This filename may vary on various distributions. For Ubuntu it is /etc/bash.bashrc. – Andrejs Cainikovs Jul 29 '10 at 15:29
Actually, in the original manual there's only a reference to /etc/profile. So apparently any other files in /etc are installation dependent, but the original docs don't say anything about this either. – Dennis Williamson Jul 30 '10 at 9:14

Set the permissions of the file to be world readable:

chmod 644 /path/to/your/file

Some shells don't understand the source command, so to make it work more broadly use:

. /path/to/your/file

even though it appears that you may only be using Bash.

Put that in each users' ~/.bashrc or to make it simpler, put it in /etc/bash.bashrc so it's available to every user without having to maintain it in individual files.

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.