Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 refer to to set environment variables.

I'm required to set some variables (GRIFFON_HOME and GROOVY_HOME) for a user and also I want to include bin folders to my PATH so I edited ~/.pam_environment as follows.


and I executed following command

source ~/.pam_environment

After this, both griffon and groovy commands are included in my PATH but after I exit that terminal and reopen another terminal and try to execute groovy or griffon, both commands are not included in my PATH. But I've found that the variable GROOVY_HOME and GRIFFON_HOME are still set.

How can I have my PATH to include the bin folders permanently?

share|improve this question
up vote 2 down vote accepted

Put PATH=$PATH:$GRIFFON_HOME/bin:$GROOVY_HOME/bin in your ~/.bash_profile file instead of the ~/.pam_environment file.

Alternatively you can add the following to your ~/.bash_profile file:

if [ -f ~/.pam_environment ]; then
   source ~/.pam_environment
share|improve this answer
~/.bash_profile doesn't exist but I have put PATH=$PATH:$GROOVY_HOME/bin:$GRIFFON_HOME/bin into my ~/.profile and is working fine. Is there any difference between setting up in .bash_profile and .profile? Also .profile and .bash_profile is set to not recommended in to set environment variables. – TheKojuEffect May 11 '13 at 13:13
The first shells used a .profile file to load the environment for the user, bash will read the .profile file if a .bash_profile file doesn't exist to maintain backwards compatibility. I do not know the help article recommends not setting environment variables in either the .profile or .bash_profile files. Unless this is something new for 13.04. On my system the default .profile file that is provided to users by Ubuntu has path information in it. – notkevin May 11 '13 at 16:49

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.