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 want to append the directory /home/bart/bin to my PATH. By my PATH, I mean that it should be available whenever I login, whether it be via the terminal, Gnome, KDE or SSH, but not for other users. What's the recommended way of doing this?

share|improve this question
up vote 4 down vote accepted

Append your directory to PATH in /home/<user name>/.bashrc and source .bashrc from /home/<user name>/.profile using

if [ -f ~/.bashrc ]; then
. ~/.bashrc

This way your changes will be available to you only in both GNOME & KDE and also in bash.

Do not edit /etc/profile as it will make the changes for all users.

share|improve this answer
Well, what do you know, apparently .profile already contains by default: # set PATH so it includes user's private bin if it exists \n if [ -d "$HOME/bin" ] ; then \n PATH="$HOME/bin:$PATH" \n fi – Bart van Heukelom Dec 30 '10 at 13:00

Adding the appropriate line in .bashrc in your home folder should be enough for terminal and ssh. However, i don't understand how your path will make a difference in Gnome(maybe it might in the run utility, but not sure about it).

Add the line PATH=/home/bart/bin:$PATH in your .bashrc. Run source ~/.bashrc to test the new path settings if you change .bashrc from the terminal.

share|improve this answer
Indeed, that won't work for the run utility – Bart van Heukelom Dec 30 '10 at 10:22
Look at, it talks about changing /etc/profile, that may help you. – apoorv020 Dec 30 '10 at 10:26
It works for me. I just ran a script in the run dialog from ~/bin, which is only sourced in ~/.profile. I just made a quick script to say some things with espeak and it did. If you just created ~/bin you may need to log out. – Deadite81 Dec 30 '10 at 10:27

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.