Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

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?

share|improve this question

migrated from stackoverflow.com Jul 13 '13 at 20:43

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

Have you tried removing the .sh extension? Maybe Nautilus (or whatever file browser you're using) checks that. –  tjameson Jul 13 '13 at 1:59
yeah, I removed the extension and nothing happens –  user2576376 Jul 13 '13 at 2:02
please send us ls -la of the script. check that the mountpoint is not mounted noexec. –  mnagel Jul 13 '13 at 2:52
This is surely not a programming question--please ask on SuperUser instead. –  John Zwinck Jul 13 '13 at 4:17

1 Answer 1

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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