Tuesday, January 23, 2007

Modify path in UNIX

To modify your path

If you are using csh or tcsh, at the shell prompt, enter: setenv PATH $PATH\:/dir/path If you are using sh, ksh, or bash, at the shell prompt, enter: PATH=$PATH\:/dir/path ; export PATH In all cases, replace /dir/path with the directory you want the shell to search.

Note: The earlier entries in the path take precedence over the later ones. If you want the directories you add to your path to take precedence, then in the examples above, replace $PATH\:/dir/path with /dir/path:$PATH .

If you want to make these changes permanent, then add the commands described above to the end of your .cshrc file (for csh and tcsh), .profile file (for sh and ksh), or .bash_profile file (for bash).

No comments: