7

I typed something in Bashrc and I can not use commands like cp, gedit, ls, etc. etc anymore. The terminal give me a message like:

Command 'ls' is available in '/bin/ls'
The command could not be located because '/bin' is not included in the PATH environment variable.
ls: command not found

I tried to restore bashrc, but I need to use cp and I can not use this command either:

Command 'cp' is available in '/bin/cp'
The command could not be located because '/bin' is not included in the PATH environment variable.
cp: command not found

What could I do? Thank you.

muru
  • 207,228
ogs
  • 71

1 Answers1

31

It looks like your PATH variable got messed up.

If this ever happens to you, and you are running a /bin/sh (or variant such as /bin/bash)....enter the following on the command line:

 export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin

Then you will be able to easily use the base UNIX commands without having to prefix them with /....blah..../command while you are fixing the problem.

Jeremy Kerr
  • 27,829
mdpc
  • 1,219