Wilmott-IT Services - Central Coast based Business IT Systems Management.
AusWebHost - Australia Based Web Hosting Provider. Offering Web Hosting, Dedicated Servers and other Hosted Services including Hosted Email
myTravelBlog - Create your own travel blog for free today! Link to Facebook to automatically update your status and photos everytime you submit a story!

Monday, February 14, 2011

How to add a program / directory to your PATH, Ubuntu /Debian

Every once and a while you need to add a program or directory to your path variable. Adding something to your PATH makes life easier because you dont have to type out the full path to the executable rather you can reference the executable directly ie instead of /usr/bin/ls you can simply run ls (note /usr/bin should already be in your PATH).

Anyway, the means of adding the variable differs but generally the consensus is you should add the directive to your .bashrc file as it applies to both the cli and the gui environment.

You will find your .bashrc file in your home directory. To edit it type
gedit ~/.bashrc
This will open the file in gedit ready for you to edit

Scroll to the bottom of the file and add

PATH=$PATH:/some/path/you/would/like/to/add;export PATH
Save this file. You may need to reopen your terminals or relogin for it to take affect. This will add the "/some/path/you/would/like/to/add" path to your PATH environment variable. Now any binary you have residing in this path will be available directly.

No comments:


Hack a Day


IntoMobile » Android


Koen's blog

Interesting Blogs