sudo gives me command not found :(

Discussion in 'Mac Programming' started by Freida, Jul 17, 2011.

  1. Freida macrumors 65816

    Joined:
    Oct 22, 2010
    #1
    Hello guys,

    I'm not that good with terminal so please bear with me but I am trying to install darwin version of something that is for mac. I follow all the instructions in the manual but when I do:
    sudo filename.exe
    it asks for password so I put in my admin password (as that is the only password I have and it works for installing apps etc. and I am the only user here - admin)
    and it says
    sudo: filename.exe: command not found

    Any ideas what I am missing here?
     
  2. willieva macrumors 6502

    Joined:
    Mar 12, 2010
    #2
    filename.exe isn't in your path.

    Try:
    sudo ./filename.exe

    If that doesn't work, you need to find filename.exe.

    Try:
    find ~ -name filename.exe

    If the output of that command is something like:
    /Users/freida/Downloads/PackageName/filename.exe

    the change to that directory by typing:
    cd /Users/freida/Downloads/PackageName

    and trying the sudo command from earlier in the message.
     
  3. Freida thread starter macrumors 65816

    Joined:
    Oct 22, 2010
    #3
    thank you for your reply, unfortunately it doesn't work either. I am in the right directory so when I do ls it gives me all the files in that directory including the file i need

    I still get the same message after I enter the password ;(
     
  4. willieva macrumors 6502

    Joined:
    Mar 12, 2010
    #4
    Type the following commands and post the output:
    file filename.exe
    ls -l filename.exe
     
  5. Freida thread starter macrumors 65816

    Joined:
    Oct 22, 2010
    #5
    first command gives


    vray_demo_maya2012_snow_leopard_x64.exe: Mach-O universal binary with 2 architectures
    vray_demo_maya2012_snow_leopard_x64.exe (for architecture i386): Mach-O executable i386
    vray_demo_maya2012_snow_leopard_x64.exe (for architecture x86_64): Mach-O 64-bit executable x86_64


    second gives


    -rwxr-xr-x@ 1 Freida staff 20343134 29 Apr 12:19 vray_demo_maya2012_snow_leopard_x64.exe
     
  6. jiminaus macrumors 65816

    jiminaus

    Joined:
    Dec 16, 2010
    Location:
    Sydney
    #6
    Just in case you missed it, but given the information to date, I can't see why this wouldn't work.
    Code:
    sudo ./vray_demo_maya2012_snow_leopard_x64.exe
    
     
  7. willieva macrumors 6502

    Joined:
    Mar 12, 2010
    #7
    You could try setting your path to the directory that contains the exe file. To find out which shell you're in, type:
    ps

    If you're in bash, type:
    export PATH=[the path to your exe file]:$PATH

    in csh, type:
    setenv PATH [the path to your exe file]:$PATH

    then run the sudo command again. Please post the command you're running and the output.
     
  8. Freida thread starter macrumors 65816

    Joined:
    Oct 22, 2010
    #8
    thank you guys for your help. I don't know what happened but when I tried it after restart it worked. So, all is good now.
    Anyway, thanks for help as I've learnt new things so I totally appreciate that :)
     

Share This Page