How do I create an executable for a shell script in Ubuntu?

I wrote a simple wrapper script called that dims the screen brightness every time I run it. However, I don't want to open a terminal and execute bash

every time.

Instead, I want to create some kind of executable that I can place on my Desktop that will run my script on double click. One answer I found here on the askUbuntu forums did not work for me.

Is there any other way to do this?

I am using Ubuntu 14.04 (Trusty Tahr)


source to share

1 answer

An executable in linux is a file with an executable bit. So you just change it with chmod


chmod +x


Then you can start it with:



You can also launch it by double clicking on many graphical Linux distributions.

You're also better off providing "Shebang": the first line of your script should specify "interpreter":



Or any other interpreter ( on the first line of your file ).



All Articles