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 you are 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
But – this $PATH is reminded only during this session!
Better is to put program into $PATH that way:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
or
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.profile
or
echo 'export PATH=path/to/your/program:$PATH' >> ~/.profile
Then re-execute bashrc or profile:
. ~/.bashrc
This commands write $PATH at the end of file ~/.bashrc or ~/.profile. Read about these two files from links below.
Thanks to original article:
http://askubuntu.com/questions/109381/how-to-add-path-of-a-program-to-path-environment-variable
Check also:
http://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
and:
http://superuser.com/questions/183870/difference-between-bashrc-and-bash-profile/183980#183980