Execute a BASH script... by double-clicking on it?

Maybe change the extension name to .command, but I think there should be some workaround to make .sh work.

To run by double click on the icon: open terminal and cd to directory of script. then chmod +x . finder will decide if it is excutable or not.


  1. Go to your Terminal or iTerm.

  2. Change to directory where your file is located.

  3. Type the following:

    chmod a+x (yourscriptname)

  4. Right click on your file and select Open with and Other.

  5. Enable All Applications and choose Terminal.

  6. NOTE: If you always want to open that file with Terminal, then check Always Open With.

  7. Finally, double click on your file and it should work.