7 Replies Latest reply: Jan 24, 2013 4:07 PM by rghi
rghi Level 1 (0 points)

my professor posted a .command file on our school website for us to download but i can't seem to get it to open.  the terminal pops up and i'm not sure what to type in it

  • davidsignal Level 3 (540 points)

    its a shell script.  the terminal pops up because it is runinng, but you can open terminal first and do a "cd ~/downloads" (or whatever directory you downloaded it to) and then run the command with "./nameofyourfile.command"

  • rghi Level 1 (0 points)

    i'm really dumb when it comes to this kind of thing... so i should be able to just copy and paste cd ~/downloads into the terminal?

  • rghi Level 1 (0 points)

    it says that permission is denied

  • davidsignal Level 3 (540 points)

    run it as superuser then:  "sudo ./yourfile.command"

    if that doesn't work then:  "chmod 777 yourfile.command"  followed by "./yourfile.command"

  • rghi Level 1 (0 points)

    I get this message...


    WARNING: Improper use of the sudo command could lead to data loss

    or the deletion of important system files. Please double-check your

    typing when using sudo. Type "man sudo" for more information.



    To proceed, enter your password, or type Ctrl-C to abort.





    should i proceed?

  • davidsignal Level 3 (540 points)

    If you trust your professor.  What is the script supposed to do?  You can open it with a text editor and verify what commands he put in the script.  Sudo will run the script as superuser (root access).   If you don't know what the commands in the script do, do the second suggestion I posted in the previous reply:  "chmod 777 yourfile.command" followed by "./yourfile.command".   This will give your user account, your group, and other users access to read, write and execute the file.  If there are commands in script that try to access directories or files that you do not have access to, they will fail.


    What kind of class is this?  Most shell scripts end in .sh, so this seems to be something specifically created for Mac OSX users.  If you are in a computer/IT-related degree program, you should probably learn what the shell commands do anyway.

  • rghi Level 1 (0 points)

    I trust my professor.  I'm taking a Statistics course online and he posted a file with instructions in it for us to create a class default directory structure.