Not able to execute standard commands on centos 7 server
I am not able to run basic commands on my centos 7 server. The PATH variable looks correct I think. I have not seen this before and not sure what to do next. Thank you .
# cd /usr/bin
bash: ls: command not found...
Similar command is: 'lz'
bash: nano: command not found...
# echo $PATH
You have /usr/sbin in your PATH setting twice. Having any directory in PATH more than once will slow down access to any utilities found in any directory after the second occurrence of that directory.
Unless you have some utility that appears in more than one of the directories in PATH, you want the directory that contains the most frequently used utilities first in your PATH and the directory containing the utilities that are the least frequently used last in your PATH. Under usual circumstances, you'll want to put /usr/bin first in PATH (and get rid of one of the /usr/sbin entries and one of the /root/bin entries) like:
Given the naming conventions used on the directories in your PATH, is there also a /root/sbin directory containing utilities that you sometimes want to find? And, as Jim suggested, if your system has /bin and /usr/bin as distinct directories, be sure that both of them are included in PATH.
The Following User Says Thank You to Don Cragun For This Useful Post: