Terminal keeps saying "Command not found"

Discussion in 'macOS' started by blue439, Jan 19, 2011.

  1. blue439 macrumors newbie

    Joined:
    Mar 24, 2009
    #1
    ... for everything. Path variable search turned this up:

    Last login: Tue Jan 18 19:03:34 on console
    Welcome to Darwin!
    [Les-Kanekunis-Computer-2:~] kanekuni% /usr/local/bin/ls
    tcsh: /usr/local/bin/ls: Command not found.
    [Les-Kanekunis-Computer-2:~] kanekuni% /bin/echo $PATH
    /bin:/sbin:/usr/bin:/usr/sbin

    How can I get Terminal to work?
     
  2. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #2
    ls is not in /usr/local/bin. Obviously, echo works.
     
  3. blue439 thread starter macrumors newbie

    Joined:
    Mar 24, 2009
    #3
    How do I move the file to the correct location? Sorry, haven't used Terminal much.
     
  4. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #4
    You move a file with the mv command. I'm not clear on what you're trying to do, so my answers may be rather vague.
     
  5. jerry333 macrumors member

    jerry333

    Joined:
    Nov 4, 2005
    #5
    To find the location of a command type:

    which <command>

    Example.

    $ which ls
    /bin/ls

    If which ls doesn't return anything that means the command is not in your PATH. To see your path type (for clarity blank lines have been added):

    $ env |grep -i pathenv |grep -i path
    INFOPATH=/sw/share/info:/sw/info:/usr/share/info

    MANPATH=/sw/share/man:/usr/share/man:/usr/local/share/man:/usr/X11/man:/sw/lib/perl5/5.10.0/man:/usr/X11R6/man

    PATH=/sw/bin:/sw/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin:/Users/jerry/bin:/Users/jerry/scripts:/usr/local/bin:/Users/jerry/bin:/Users/jerry/scripts:/usr/local/bin
     
  6. plinden macrumors 68040

    plinden

    Joined:
    Apr 8, 2004
    #6
    Whoah, what? You want to move ls? It's already in the correct location, "/bin", with all the other basic Unix commands.

    Don't bother trying to include the path in the command - just type ls. Since /bin is in the PATH environment variable Terminal will find it.
     
  7. jerry333 macrumors member

    jerry333

    Joined:
    Nov 4, 2005
    #7

    ls is a system command. You shouldn't be moving it.
     
  8. Cinder6 macrumors 6502

    Cinder6

    Joined:
    Jul 9, 2009
    #8
    /usr/local/bin is supposed to hold commands not included by the OS--i.e. stuff you install.

    See:
    Code:
    man hier
    for more details.
     
  9. blue439 thread starter macrumors newbie

    Joined:
    Mar 24, 2009
    #9
    Okay, so how do I set the correct path so I can use Terminal. Thanks for the replies.
     
  10. belvdr macrumors 603

    Joined:
    Aug 15, 2005
    #10
    It's already set by default. If you want to use ls, then type ls and hit Enter.

    Instead of the mass confusion that is seen earlier in this thread, explain what you're trying to do and the error that is being thrown.
     
  11. cwik macrumors newbie

    Joined:
    Aug 12, 2008
    Location:
    city of Angels...
    #11
    please help...terminal not working

    i have the same problem with terminal...somehow my path got messed up.

    i type ls (or any other command) and all that comes up is:
    bash - command not found

    so, as the other guy asked, how do i reset my path so that terminal works?

    much thanks guys...i really appreciate it...(im obv a term-newb)

    cwik
     
  12. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #12
    Copy and paste exactly this command into a Terminal window:
    Code:
    echo $PATH
    
    Then make a screen shot of the window and post it.

    I'm asking for a screenshot because I want to see the whole context.


    Making and uploading screen shots:
    http://forums.macrumors.com/showpost.php?p=15977842
    http://guides.macrumors.com/Taking_Screenshots_in_Mac_OS_X
    http://forums.macrumors.com/showpost.php?p=14126379&postcount=16
     

Share This Page