Algunos artículos de interés

domingo, enero 29, 2006

Adding a Directory to the Path in Linux

Adding a Directory to the Path in Linux:

The $PATH environment variable is a list of all directories in which Linux will look for commands, scripts and programs. Linux uses the bash shell.

To add a path we can edit the file profile located in the /etc
But if we open the /etc/profile we will read the next warning:

# PLEASE DO NOT CHANGE /etc/profile. There are chances that your changes
# will be lost during system upgrades. Instead use /etc/profile.local for
# your local settings, favorite global aliases, VISUAL and EDITOR
# variables, etc ...

So, it is better to use the /etc/profile.local to add our personal paths.

So, we will open the /etc/profile.local file and insert the following line at the end of the file:

export PATH=$PATH:/newdirectory

where /newdirectory is the name of the path we want to add. We save and close the file and our new directory will be already in the path.

(You can see the value of $PATH or $HOME by typing echo $PATH, or echo $HOME. Please note that the root user will have a different path than common users.)

--  Chimo (Joaquín Campos Muñoz) http://www.chimo.es  

No hay comentarios: