How do I run executable scripts in Nautilus?

When I double-click on a script in Nautilus to run it, the script just opens in my text editor with no option to run it. Using Nautilus, how do I run executable text files and/or scripts?


  1. Open Nautilus.

  2. Open this from the menu bar:

    Edit → Preferences

  3. Select the 'Behavior' tab.

  4. Select "Ask each time" under "Executable Text Files".

  5. Close the window.
  6. Right click the file, and select "Properties.
  7. Select the "Permissions" tab, and make sure "Allow executing file as program" is selected.

  8. Close the window.

Now you can double-click your executable text file in Nautilus to be asked whether to execute or edit your script.

enter image description here


Answer credit: Nur


Follow these steps:

  • Install dconf-editor because it isn't installed by default.
  • Hit Alt+F2, type dconf-editor and hit Enter.
  • In dconfg-editor goto: orggnomenautiluspreferences

    enter image description here

  • Click on executable-text-activation and from drop down menu select:

    launch: to launch scripts as programs.

    OR

    ask: to ask what to do via a dialog.

  • Close dconf-editor. That's it!