0

Can anybody explain what is wrong with my terminal:

 
$ echo $PATH
=/usr/local/bin
$ ls
-bash: ls: command not found
$ cd
-bash: find: command not found

Why won't these commands work? Help? Anyone?

cantdutchthis
  • 31,949
  • 17
  • 74
  • 114

2 Answers2

4

I'm guessing your .bash_profile or .bashrc has a line that looks like

export PATH=/usr/local/bin

This is overwriting all the existing stuff that needs to be in your $PATH. You need to change this line to look like

export PATH=/usr/local/bin:$PATH
Lily Ballard
  • 182,031
  • 33
  • 381
  • 347
  • how do i do this from a non functional terminal? where is the .bash_profile or .bashrc file located? – cantdutchthis Mar 05 '13 at 23:54
  • @VincentWarmerdam: What command-line editor do you like to use? You can always use the full path to commands, e.g. `/usr/bin/nano ~/.bash_profile`. And these files live in your home dir. – Lily Ballard Mar 06 '13 at 00:01
1

"ls" lives in "/bin" and "find" lives in "/usr/bin". You need to add these to your $PATH in your bash_profile or .bashrc.

Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215