0

When I double click on a .sh (the file is executable) file in Nautilus the archive manager is started instead of executing the script. How can I make Nautilus show the dialog (execute/edit/...) again?

2 Answers 2

1

Try changing the permission of the file to executable using terminal.

Open terminal. Navigate to the directory where your file located (using cd). Change the permissions using:

chmod +x filename.sh  

and then try

./filename.sh  

or try executing it using

sh filename.sh

Reasons :

It may be because, your default text editor(gedit) may not be available, or in properties window, on the open with tab, the default one is archive manager. In this case change open with using gedit or install gedit (if not available).
Or the file is meant for 32 bit, and you may be executing in 64 bit OS (vice versa).

2
  • if it's a shell script, it's irrelevant what architecture he's using. shell scripts aren't compiled, so they are architecture-independent.
    – strugee
    May 23, 2013 at 2:29
  • The file has the executable-flag. I changed the "open with" to gedit, but now the script is opened in gedit instead of executing it. I can launch the script using ./filename.sh, but it should also be possible with nautilus. May 23, 2013 at 20:34
0

You can do this one of two ways.

Way Number One: GUI

Right click the file

Select the permissions tab

Check the box that says "Execute file as a program"


Way Number Two: Terminal

The first way does not always work for me so i use this one instead

Open the terminal with Ctrl + Alt + T

Navigate to the directory your file is in using cd (ex. if your file is in your Downloads folder you would use the command cd ~/Downloads

Finally execute the command ./name_of_file_here.sh

1
  • Thanks for your answer, I checked the first way, the checkbox is already checked, but although I can't execute the script... Currently I'm executing the scripts with the terminal, but I don't know why ubuntu isn't showing this dialog any more... May 21, 2013 at 22:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .