When I double click on text files, nautilus asks me what I would like to do with them. I find this to be intrusive, as I just want them to open.

How can I fix this?

Note: This question is a "canonical" question on the subject; edit if needed.
Note 2: Text files can be HTML, CSS, TXT, and more.


Go to Edit>Preferences>Behavior in Nautilus, and change this option:


What these options mean:

"Run executable text files when they are opened"
This option will execute (run) text files as if they are programs (or scripts), but note that if the files are not scripts or have errors, you won't see a thing.

Note: This option is very risky, because it could allow you to run dangerous scripts accidentally.

"View executable text files when they are opened"
This option will provide the most comfortable behaviour, if you just need to view your text files (HTML, CSS, txt, etc). When you need to run actual scripts, you can right click them and choose to run them from the context menu, or use a terminal.

"Ask each time"
This option provides a safe balance between the two other options, allowing you to choose each time you double click on a text file, and providing a prompt that should help to avoid running risky files accidentally.

  • The filemanager ask for execution only if the exec bit is set, so it make sense to me. Better to remove the exec bit when unneeded. – enzotib Nov 28 '11 at 17:00
  • @enzotib the person who originally brought up the issue had this happening with all text files. – RolandiXor Nov 28 '11 at 17:08
  • I think the first option is wrong: the choice is valid only for files that are both executable and text file. Non-executable are always open in the editor (or whatever application they are associated with). – enzotib Nov 28 '11 at 17:13
  • @enzotib: yes, but read my comment again :). – RolandiXor Nov 28 '11 at 19:58

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.