How to add something to PATH ? I have added like
PATH=$PATH:/home/example
export PATH
and it works until I restart , after that when I type env in PATH there is no /home/example.
set it in your ~/.bash_profile or ~/.profile (depending on your bash configuration).
Its just a set of commands that run each time a new bash instance is started. That's always been my hacky way of doing it. It works, so i never sought anything better.
mizar:branches peelman$ cat ~/.bash_profile
complete -W "$(echo `cat ~/.ssh/known_hosts | cut -f 1 -d ' ' | sed -e s/,.*//g | uniq | grep -v "\["`;)" ssh
PATH=$PATH:/opt/local/bin/:/usr/local/git/bin/:~/bin/
SVN_EDITOR=/usr/bin/nano
EDITOR=/usr/bin/nano
alias restartgrowl="killall GrowlHelperApp && open -a GrowlHelperApp"
...
mizar:branches peelman$