Mac – bash- command not fount error

bashcommand linemacpathterminal

I tried to install omnet++ on my Macbook pro (OS 10.10) yesterday. I got an error so I delete path in my bash-profile.

Now, every command I try to run in my terminal shows an error of command not found. I try many ways but did not find a answer.

enter image description here

Best Answer

First, get your PATH back for the current shell by running

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

Then fix the PATH problems

  • edit your bash-profile and put back the line you've deleted. If you don't remember, take the two lines from above
  • path_helper takes its input from the files in /etc/paths.d, at least one of those files seems to be corrupt (the last two entries in the output look kind of strange). To fix, run /bin/ls -l /etc/paths.d to get the name of the file containing the additions for omnet++ (should be named accordingly) and remove it with sudo /bin/rm /etc/paths.d/NAME-OF-FILE