This question already has an answer here:

I am working on server running on CENTOS 7.

I have compiled a few software from source code. I had executed ./configure, make, make install as SUPERUSER.

To be accessible I need to set a PATH. I added the following lines in ~/.bashrc file as SU

for adding PATH to HISAT2

export PATH="/home/bioinformatics/Arindam/Software/Hisat2/hisat2-2.1.0/:$PATH"

As SUPERUSER it worked fine. But once I moved out of SU I was not able to do so. Next I added the same lines in ~/.bashrc but not as SU and this did my job pretty well.

Now I need the software to be accessible to other users as well. How do I do it. Which file must be editted ~/.bashrc, ~/.bash_profile, /etc/profile and should I do it as SU?

Is there any other alternative?

marked as duplicate by Ipor Sircer, Romeo Ninov, Jeff Schaller, Stephen Kitt, Kusalananda Dec 6 '17 at 11:06

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Just add your PATH to /etc/profile or if you prefer create a .sh in /etc/profile.d/ with you path and it will be added to all users upon login.

  • I created a new file and put the above lines inside it. However it is still not working. Do I need to do anything else? Like source? – Arindam Ghosh Dec 6 '17 at 10:32
  • Yes. You should source the /etc/profile.d/ directory on your /etc/profile – BANJOSA Dec 6 '17 at 18:19

you can add your PATH definition to the /etc/environment.

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