Can’t run basic commands in console

For the first time, an incident of being unable to execute ‘ls’ happened.

The issue was, he can run it via /usr/bin/ls but not just ls.

The solution is, check environment variables: echo $PATH

if the absolute path of executable files is not shown, add it by:

PATH=”directory:$PATH”

e.g

PATH=”/usr/sbin:$PATH”

or

export PATH=$PATH:/usr/sbin

Tags:

Leave a Reply

Name and Email Address are required fields. Your email will not be published or shared with third parties.