sudo: command not found - Is this normal?

Discussion in 'General Mac Discussion' started by bluemoon, Sep 9, 2004.

  1. bluemoon macrumors member

    Joined:
    Aug 2, 2004
    #1
    i was trying to use the sudo command in my terminal when i got this:

    tcsh : sudo : command not found

    is this normal? i really no idea.... thanks in advance.
     
  2. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #2
    No it is not.

    Could be your path is FUBAR. Verify it by seeing if sudo is in /usr/bin, as it should be. If it is, show us what your path is:

    echo $PATH
    echo $shell

    If it's not, then it sounds like you might have installed OS X and not installed BSD Subsystem. Use Pacifist to get that installer of your OS X CDs/DVDs.
     
  3. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #3
    echo $path

    /bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin

    echo $shell

    /bin/tcsh

    erhmm... sorry..dun understand bout the FUBAR part and checkn the usr... where is that usr? anyway... was using it fine the other day... just tat i suddenly cant use it... i tried installing tinyfugue but din fully install it yet... and i accidentally moved the utilities folders to trash but took it out.. any idea wat's happening? or wat i can i do to salvage my situation?
     
  4. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #4
    If your path really looks like this, then it's screwed up. There should not be a comma in the path.
     
  5. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #5
    there's a comma after sbin isnt there?anyway... wat can i do to retify the problem?
     
  6. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #6
    Sorry, it was supposed to say should NOT be a comma.

    Please verify the output of

    echo $PATH

    And make sure there's not a comma in there.

    Do you have a .login or a .cshrc or a .tcshrc in your home directory?
     
  7. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #7
    hmmm.. the one above is correct.. it does have a comma there... hmmm...sorry man, i am quite a hopeless person at the whole terminal thing... dont understand wat u meant by home directory.. sigh.... i guess i am in big trouble?
     
  8. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #8
    Before you start fiddling with UNIX and the command line, you should familerize yourself with it's workings. Here is a good starting place for a tutorial:

    http://osxfaq.com/Tutorials/LearningCenter/index.ws


    The home directory is your home folder, where your Documents, Pictures, Music, Movies, etc are. If you have a comma in your path, then that is why sudo doesn't work. Please post the results of:

    ls -laF ~
     
  9. blodwyn macrumors 65816

    Joined:
    Jul 28, 2004
    Location:
    Portland, Oregon
    #9
    FUBAR = Fouled Up Beyond All Recognition

    There's also SNAFU = Situation Normal, All Fouled Up

    I believe there are alternatives based on another word that also begins with 'F' ;)
     
  10. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #10
    somehow i feel as if i am threading into hell... well... i am at the next lower level of the pits now... ls: command not found...

    i somehow think i am in serious trouble....

    i gotta go sleep now.. sigh.... how can i contact u to ask with regards to this? or u can just post the method.. will be back tomorrow...
     
  11. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
  12. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #12
    drwxr-xr-x 17 admin staff 578 9 Sep 00:50 ./
    drwxrwxr-t 7 root admin 238 6 Sep 13:15 ../
    -rw-r--r-- 1 admin staff 3 31 Aug 00:38 .CFUserTextEncoding
    -rwxr-xr-x 1 admin staff 6148 9 Sep 00:53 .DS_Store*
    -rw-r--r-- 1 admin staff 0 19 Sep 2003 .MCXLC
    drwx------ 11 admin staff 374 10 Sep 00:59 .Trash/
    -rw-r--r-- 1 admin staff 33 3 Sep 13:07 .cshrc
    drwx------ 3 admin staff 102 9 Sep 01:50 .irssi/
    drwx------ 15 admin staff 510 10 Sep 00:58 Desktop/
    drwx------ 7 admin staff 238 6 Sep 13:15 Documents/
    drwx------ 35 admin staff 1190 10 Sep 01:08 Library/
    drwx------ 3 admin staff 102 19 Sep 2003 Movies/
    drwx------ 6 admin staff 204 3 Sep 23:13 Music/
    drwx------ 4 admin staff 136 31 Aug 00:40 Pictures/
    drwxr-xr-x 3 admin staff 102 3 Sep 23:40 PoisonDownloads/
    drwxr-xr-x 4 admin staff 136 19 Sep 2003 Public/
    drwxr-xr-x 5 admin staff 170 19 Sep 2003 Sites/

    this?
     
  13. tomf87 macrumors 65816

    tomf87

    Joined:
    Sep 10, 2003
    #13
    It is most likely in /etc/profile.. Open Terminal and run:

    /usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile

    Check the PATH variable in it.. For yours, it should read:

    /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

    NOT
    /bin:/sbin:/usr/bin:/usr/sbin,/urs/local/bin


    Then save the file if you had to change it.
     
  14. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #14
    Nahh, it's all because your $PATH has been messed up. Fast fix from the terminal would be:

    set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin

    (My tcsh is rusty, you might need to use setenv)

    that will fix that specific terminal session so the commands can be found.

    Then you need to open the files listed above and fix the path.
     
  15. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #15
    i did the /usr/bin/sudo /usr/bin/open -a TextEdit /etc/profile

    and got this for my path:"/bin:/sbin:/usr/bin:/usr/sbin"

    so do i still edit till it becomes : /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin ?

    tried the fast fix : set PATH = /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin but nothing happened... thanks for all the help... i am like a noob to all this programming thing... really appreciate all you ppl...:)
     
  16. mms macrumors 6502a

    Joined:
    Oct 8, 2003
    Location:
    CA
    #16
    The usual disclaimer:
    Don't use sudo unless you know what you're doing.

    I would go educate myself with at least the basics of the command line before using sudo as you can seriously screw up your system that way.
     
  17. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #17
    Hmm, sounds like you might have a personal file messing it up:

    try

    /usr/bin/open -a TextEdit ~/.profile

    (notice the "." in front of the name there)

    And see if there is a line in there that modifies the path. you need to do two things:

    1) Change that comma into a colon ":"
    2) Change the /urs at the end into a /usr
     
  18. tomf87 macrumors 65816

    tomf87

    Joined:
    Sep 10, 2003
    #18
    From the directory listing above, it appears there isn't a .profile. There is a .cshrc however, so I'd check there.

    /usr/bin/open -a TextEdit ~/.cshrc
     
  19. stcanard macrumors 65816

    stcanard

    Joined:
    Oct 19, 2003
    Location:
    Vancouver
    #19
    Told you my tcsh was rusty. I've been a bash person for a long time. (I also apparently don't read very well)

    Come to think of it, you should also check /etc/csh.login and /etc/csh.cshrc -- I assume tcsh uses those?
     
  20. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #20
    typed /usr/bin/open -a TextEdit ~/.cshrc and got this:

    set path=($PATH,/urs/local/bin)

    typed /etc/csh.login and got permision denied.

    typed /etc/csh.cshrc oso has permission denied.

    yet to edt anything cos i dun noe wat to edit..
     
  21. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #21
    There's your problem. It should be:

    $PATH:/usr/local/bin

    Colon, not comma. Change that and open Terminal and all will be correct. IMO, declaring path is much better to do in a ~/.login. Read that UNIX tutorial.

    edIt BEcAUsE I dON'T KnoW wHat
     
  22. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #22
    oops... sorry for that lazy english.. now i got this after editing it....

    tcsh: Bad : modifier in $ (/)

    hmmm.... now what do i do with this message? i get it everytime i log in now...sigh... thanks for helping :)
     
  23. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #23
    Sorry, my fault there..

    Edit that file again.

    change it to:

    set path = ($PATH /usr/local/bin)

    Open Terminal. Verify that it's working with:

    echo $PATH

    It should look like this:

    Code:
    yellow% echo $PATH
    /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
    
     
  24. yellow Moderator emeritus

    yellow

    Joined:
    Oct 21, 2003
    Location:
    Portland, OR
    #24
    Personally, I would prefer that you take the whole path declaration out of your .cshrc and put it in a .login, thusly:

    setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
     
  25. bluemoon thread starter macrumors member

    Joined:
    Aug 2, 2004
    #25
    thanks a million Yellow...u saved me.... and my baby mac..:) hee... think everything should be fine now... don't quite understand about the .login though... wat am i supposed to do? create a new file or just type in that command : setenv PATH "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin" ?
     

Share This Page