|
|
Sponsored Links
|
Maxabout.com > Tips
Adding a directory to the PATHAdded on:8/22/2008 12:30:30 AM In Linux Tips Rated by 1 users
- Commands that you type on the shell command line are searched in the directories listed in the PATH variable:
echo $PATH
- When several directories contain a command with the same name (a bad situation), the first directory encountered in the PATH has priority. To find out the directory that contains the command that will be executed:
which command
- To add a new directory 'newdir' to the PATH:
- If the shell is sh or bash (check with echo $SHELL):
export PATH=newdir:$PATH
- Place these lines in the file '.bashrc' in your home directory to have the PATH set correctly the next time you open a shell.
- If the SHELL is tsch or csh:
set path = (newdir $path) rehash
- Place these lines in the file '.cshrc' in your home directory, to have the correct PATH the next time you open a shell.
|
Sponsored Links
Tools
Bookmark/Discuss
|
|
|