Thursday, May 16, 2013

How to add path of a program to $PATH environment variable?



How to add path of a program to $PATH environment variable?



Firstly, check your original path:
echo $PATH
It should show something like this:
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
Now add your program to that path, ensuring your using the entire path all the way from / to your program.
export PATH=$PATH:/path/to/my/program
This sets your PATH variable to the existing PATH plus what you add to the end. Check that it has been added:
echo $PATH

No comments:

Post a Comment