How can I modify the output of $PATH
from
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin:/root/bin
to
$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin
I guess it should be
PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/puppetlabs/bin'
For temporary
export PATH
For permanent add the above $PATH
line in your ~/.bashrc
file
. ~/.bashrc
will all work just as well. And on any well-managed system, if you are not root you should not be able to access any files in /root/bin
so having that in the PATH is not a problem.
root
user, then having/root/bin
on the end is acceptable. If you run it as a normal user you should find you don't get that part (but you might get/home/shahriar/bin
or something similar instead)