I need to start using GIT for my projects from now on and I need to use some UNIX commands. but no matter what I do, I always receive "command not found" error.
I installed MacPorts, but still cant run any UNIX command :/
When I try $ ls, I get the error below, same for sudo, or any other command:
-bash: ls: command not foundand when I try $PATH, I get the lines below:
hakan-yilmaz-MacBook-Pro:~ hakanyilmaz$ **$PATH**
-bash: /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/ No such file or directoryI'm on Mac OS X 10.6.6
I spent 2-3 days and kept Googling and trying everything I found at forums, but no success.
SOLUTION:
I opened .bash_profile and removed everything else than
export PATH=/opt/local/bin:/opt/local/sbin:$PATHThen, I reboot that Mac, and it works!
21 Answer
Your $PATH was overwritten by MacPorts in error. This is my $PATH with MacPorts installed, you should edit it accordingly and set it in your ~/.bash_profile or ~/.profile.
blackcomb:~ tyson$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin:/usr/X11/binSpecifically, you are missing /bin, /usr/bin, /usr/sbin, /sbin, /usr/local/bin and /usr/X11/bin.