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”:
- open the file for editing:
nano /home/myname1/.bashrc
- at the end, add a line like:
export PATH=$PATH:/the/path/to/add
- 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
.
Sources:
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.