The code provided here has been tested on
Ubuntu 9.10 (Karmic Koala).
There are two ways to accomplish the mission, the first is to put your application is the default path that bash already looks into while trying to execute your command, and the second is to add another location as a path that bash must check.
For the first option, run
$PATHin the terminal. Your terminal output would look something like
If you put your scripts/executables in any of the above locations, bash will find it and execute it without you having to specify the whole path.
For the second option, you need to edit the
~/.bashrcfile and add the location of the executable to the
PATHlocations. Suppose this location is
/home/pbhat/bin/. Concatenate the following line to the end of
Save and close the file and now run the following command in the terminal:
Unless you run this command the updated path will not show up.