My terminal is not recognizing the majority of commands. It won't recognize ls, ruby, python, brew, and a few others. Does anyone know how to fix this?

  • What does the prompt look like? What is your $PATH? The more information you can provide, the easier it is for others to help you troubleshoot. Best wishes! – zpletan Jan 7 '16 at 8:15
  • My $PATH is ’/usr/local/bin:?? – user164594 Jan 8 '16 at 21:34

This sounds like an issue with your PATH, run

/usr/bin/echo $PATH

My guess is that is going to be missing the required directories

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

Then try again

The PATH variable is the list of directories that will be searched when executed by the shell; this variable will not persist between bash sessions - and should be set in your ~/.bashrc file.

echo "export PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin" >> ~/.bashrc

In your shell, bash, the .bashrc file will automatically be sources on terminal creation.

You must log in to answer this question.

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