Skip to content

Setting PATHes in Linux

In Linux (like in Windows, as far as I know), you can set a system-wide PATH variable as well as a per-user PATH variables.

To add something to the path for a specific user, you need to edit .bashrc in their home foldder. E.g., for user “myname1”:

  1. open the file for editing: nano /home/myname1/.bashrc
  2. at the end, add a line like: export PATH=$PATH:/the/path/to/add
  3. save and close (CTRL+X and yes)

If you want to avoid a restart, you can also type export PATH=$PATH:/the/path/to/add directly in the terminal (this will only work for the current session).

To add something to the path for all users, the file to edit is /home/profile. So, same instructions as above but starting with nano /etc/profile.


Posted in Linux.

0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Some HTML is OK

or, reply to this post via trackback.

Sorry about the CAPTCHA that requires JS. If you really don't want to enable JS and still want to comment, you can send me your comment via e-mail and I'll post it for you.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA