Super User is a question and answer site for computer enthusiasts and power users. 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 which is not becoming an executable. I tried doing it in the properties but as soon I ticked the checkbox, the tick vanished in a second.

I then tried

sudo chmod +x

which returned nothing and after checking its properties, it dint turn into an executable. Any solutions?

share|improve this question

migrated from Jan 1 '13 at 12:36

This question came from our site for professional and enthusiast programmers.

Even if it isn't executable, I guess you can just "execute" it by . ./ – Alvin Wong Jan 1 '13 at 7:40
Maybe the file is still opened in another program? Like gedit or another terminal. – Lennart Jan 1 '13 at 13:44
@AlvinWong A closer approximation would be sh ./ - using . (equivalent of source) would parse it in the current shell, rather than spawning a subshell. – Bob Oct 24 '13 at 14:23
1) @OP: Do you intend to run that script as uid 0 (aka toor, root, admin ,...)? If not, why use sudo? 2) What happens if you open a shell, cd to the the directory the script is in and type chmod +x 3) What is the first line of Is that #!/usr/bin/env bash or similar? – Hennes Mar 9 '14 at 12:10

open the terminal and write the following command

chmod +x

Well that gonna make your file executable which can be run from terminal by simple command

sudo ./

There is another way of doing it through GUI, when you right click on the file and goto permissions tab then you get an option to make the file executable by just clicking a checkbox

share|improve this answer
I was just about to type the same thing. I suspect the "./" prefix was getting missed. – selbie Jan 1 '13 at 7:39
yupp tht was d error... and see that other way too. thtz more easy if you want to work just by GUI. If yu found my answer correct, plz mark it as accepted answer :) – Azzy Jan 1 '13 at 7:40
@Azzy I already tried what you said. Using the GUI, when I clicked the checkbox in the permissions tab, the tick vanished in a second. And when I tried what you said, it returned sudo command not found. – Ankit Agrawal Jan 1 '13 at 9:03
you don't need, and shouldn't use sudo unless you need to run it as root. Have you tried sh ./ – stib Mar 9 '14 at 12:20
  1. use gedit to write and save script with .sh extension to desktop.
  2. open Nautilus and right click the file.
    • under properties, check box "allow executing file.."
    • in Nautilus menu, click file,then preferences,then behaviour
    • check the "run executable text files when they are opened".

Now, when you double click the file, it should execute.

share|improve this answer

Check the immutability of the file with the extended attributes of the filesystem:


look for i attribute and remove it with chattr.

share|improve this answer

You must log in to answer this question.