I am having troubles with typing commands within the terminal on some of our CentOS servers. For example, I have to include the complete and full path to the command (i.e. /sbin/chkconfig vs. chkconfig). This seems to be happening for a number of the expected locations within the system wide PATH. Some of the locations affected include:
- /usr/sbin/
- /usr/bin/
- /usr/local/sbin/
- /sbin/
I was curious how I could go about correcting this for all users (globally) on the system? I know that for scripting, I always include the full path, but when I am typing commands on the server for routine maintenance or simple troubleshooting, it would be nice to be able to type the command and have it work like it used to.
Note: I have tried this command in the past and it did not work.
echo 'export PATH=$PATH:/usr/sbin' >> $HOME/.bash_profile
. $HOME/.bash_profile
echo $PATH
$PATH
shown?su
orsudo
?