0

This question already has an answer here:

I've had some problems recently with terminal. The shell isn't able to execute basic commands, since they are not being found.

Here's an example :

-bash: ls: command not found

I've been doing some research and I suspect that it's the PATH, but I have no idea how to fix it or even look at it.

Any help would be much appreciated, I'm not the most knowledgable when it comes to this stuff, just fyi.

marked as duplicate by bmike Sep 4 '14 at 1:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

To see if your $PATH variable is set:

echo $PATH

If you've set something to override it, it's likely in the files .bashrc or .bash_profile

You'll need to edit those to remove any entries overriding your $PATH variable.

Start with just mv them out the way (use /bin/mv to hit mv directly), and starting a new session to see if that fixes things.

  • If /bin/ls is missing due to path issues, /bin/mv would be too. See the linked question for several options to get out of this scenario... – bmike Sep 4 '14 at 1:31
  • If you use the actual path to an executable, it doesn't matter if you even HAVE a path variable set. – AlanGBaker Sep 4 '14 at 1:54
  • @Alan - entirely correct, which is the point. – Alex Sep 4 '14 at 5:43

Not the answer you're looking for? Browse other questions tagged .