Terminal > "-bash: command not found" for almost anything!! Mac OS X Snow Leopard

Discussion in 'OS X' started by macmania82, Apr 1, 2010.

  1. macrumors regular

    Joined:
    Apr 14, 2009
    #1
    Hi friends,

    I'm using Mac OS X Snow Leopard.

    whenever I try almost any command at Terminal, I come across an annoying message like:

    -bash: unzip: command not found
    this is a sample for i tried unzip, but it happens for so many other command as well

    so what is that? do I need to install anything to make terminal work with these commands?

    Appreciate helps! thanks
     
  2. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #2
    Sounds like the path variable may have gotten befuddled. Try running the following,

    Code:
    /bin/echo $PATH
    I get the following, but yours won't be exactly the same.
    Code:
    /opt/local/bin:opt/local/sbin:/Applications/MAMP/bin/php5/bin:/Applications/MAMP/Library/bin:/Applications/Adobe AIR SDK/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
     
  3. thread starter macrumors regular

    Joined:
    Apr 14, 2009
    #3
    Code:
    /bin/echo $PATH
    give the line below:

    Code:
    /opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.6/bin:/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/subversion/bin/:PATH
    so what does it mean? :/
     
  4. macrumors 601

    Joined:
    Aug 15, 2005
    #4
    Your PATH is messed up, particularly the end of it. Were you modifying /etc/bashrc or .bashrc in your home directory?

    You want to modify the PATH line above so the final word is $PATH, not just PATH.
     
  5. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #5
    In addition to the above, the change could have been made in a .profile folder in your home directory. This file and those mentioned by belvdr are hidden files so you will not see them in Finder unless you have hidden files shown. You may not have edited these files, some programs will edit them too, but if that's the case then they have a typo to fix.

    To open these hidden files from Terminal,
    Code:
    /usr/bin/pico filename
    I believe that's the full path to the pico editor. Not at my Mac to be certain. Alternatively,
    Code:
    open -t filename
    will open the file in TextEdit. Just make sure TextEdit edits it as plain text instead of rich text. As a last alternative, use TextWrangler, which has a open hidden option to get to these files.
     
  6. macrumors newbie

    Joined:
    Feb 4, 2014
    #6
    Problem Solved

    Copy and pasted this "export PATH=$PATH:/bin:/usr/bin" into terminal and it fixed my problem!!! :))
     
  7. macrumors 65816

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #7

    Until you close that Terminal window or even a new one you open will have the same problem. You need to find out as was advised in this necro post you revived what screwed up the path to begin with.
     

Share This Page