Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a .sh file with a #!/bin/bash header. I'm able to run it from the terminal, using chmod and ./ but is there a way to perform these two operations from the desktop (i.e. by clicking on it) ?

Btw, I'm familiar with linux, but not with OS X.

share|improve this question
Which operation do you want to perform from the desktop? The chmod or executing the script? Are you looking for a desktop shortcut to execute one specific script, or easy access to the shell from within the GUI? – Gerry Feb 1 '13 at 14:40
I'm not entirely sure what you mean but if you just want to double click on it and have it run you need to change the extension to .command. This will open it up in a terminal. – Tony Feb 1 '13 at 20:31
up vote 6 down vote accepted

You can add a .command extension to your text script.

Then use chmod 744 to make it executable.

When opened or double-clicked in the Finder it will then run from the Terminal.

share|improve this answer

Well you can wrap it inside a AppleScript, make a call to shell command (your bash script).

example: do shell script

do shell script "/bin/tcsh my-command-file-path"

save it as an application to your Desktop to run it.

share|improve this answer

You can put any commands into an AppleScript, and save the script as an applet, or a droplet, or use Automator to create applets and/or droplets. Just use the do shell script command in the AppleScript.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.