Terminal - sudo: ./script: command not found

Discussion in 'macOS' started by blasetheodore, Jan 20, 2007.

  1. blasetheodore macrumors newbie

    Joined:
    Jan 20, 2007
    #1
    (Mods please move this if its better suited elsewhere)

    I've googled this to no avail.

    I have a file (no extension) which I was instructed to run with:

    sudo ./file

    However doing so gives me

    sudo: ./file: command not found

    I'm not too terminal savvy, but I tried switching to bash, and ran it again with the same error.
    I re-installed the BSD components, but had no luck.
    sudo ls or sudo cd work fine.
    The file itself is in the ~/ directory.

    echo $PATH
    /bin:/sbin:/usr/bin:/usr/sbin
    echo $SHELL
    /bin/bash

    Anyone know what could cause this?

    Thanks,
    Blase
     
  2. aristobrat macrumors G4

    Joined:
    Oct 14, 2005
    #2
    Are the file's permissions set so that it's executable?
     
  3. setatakahashi macrumors newbie

    Joined:
    Dec 28, 2003
    #3
    First you need to check if you can execute the file using ls -l file.
    See the permissions and run the file by doing ./file.

    That's it. If you have any question, please post the output of your terminal and I'll try to help.
    --
    Emerson Takahashi
     
  4. blasetheodore thread starter macrumors newbie

    Joined:
    Jan 20, 2007
    #4
    Thanks aristobrat & setatakahashi!

    Yeah, that fixed it.

    Thanks guys, that was a bigger deal than you'd imagine. On behalf of all us noobs who walk in here without a clue, thanks for being so courteous and helpful.

    Take care,
    Blase
     
  5. setatakahashi macrumors newbie

    Joined:
    Dec 28, 2003
    #5
    No problem :eek: .

    I figured out because you said: "I have a file (no extension) which *I was instructed* to run with".
     

Share This Page