Is there a way to execute shell scripts automatically using gnome-open? If I call

gnome-open script.sh

in the terminal, the script opens in the default text editor.

However the shell-script is executed directly by double-click from Nautilus.

  • Is script executable? As in chmod +x script.sh? Also I remember there used to be a setting in gnome to specify if it should execute scripts on open or edit them, so dig around for that :) – phoops Mar 24 '14 at 11:32
  • Yes the file is executable. – lamontagne Mar 24 '14 at 12:23

You should be able to use this execute the file:


or to get another terminal to execute it with:

gnome-terminal script.sh

./ means look in the current directory, this is not usually required if prefixed by a command, which would would look in the current directory if no folders are specified.

Make sure it is executable with chmod +x script.sh.

Nautilus can do other things instead of just running it, look in the preferences under Behaviour: enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.