Ubuntu – Run .sh script on Ubuntu without using terminal

bashcommand linescripts

I'm using Ubuntu and I've created a simple script file:

#!/bin/bash
cp /home/guilherme/pictures/*.jpg /home/guilherme/backup

When I run it on terminal typing the command "./script.sh" it works fine.

But when I try to click on this file outside the terminal, it opens my text editor to edit the lines of the script instead of opening the terminal and execute the commands.

I already gave the executable permission to this file, but it does not run.

Any ideas?

Best Answer

You have to open nautilus, click File->Preferences (OR) Edit->Preferences, check Behaviour tab, and select the option you prefer for Excutable Text Files.

enter image description here

Related Question