Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Having an issues with my terminal. Every time I tap in a command such as ls i get

Patricks-MacBook-Pro:~ patrickwalsh$ ls
-bash: ls: command not found

Running

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

fixes it but only temporarily. If I close the window and reopen for example then I am back to the above problem.

Any help or advice would be great.

share|improve this question

migrated from stackoverflow.com Jun 10 '13 at 0:08

This question came from our site for professional and enthusiast programmers.

    
When the problem occurs, what does echo $PATH give you? –  mfaerevaag Jun 9 '13 at 18:17
    
It returns the following Patricks-MacBook-Pro:~ patrickwalsh$ echo $PATH /usr/local/bin –  PatGW Jun 9 '13 at 18:22

1 Answer 1

Add this to you ~/.profile or ~/.bash_rc:

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

and remove any other PATH-declarations (like the one above).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.