Thursday, May 2, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1837  / 1 Year ago, wed, november 23, 2022, 7:38:47

Yes, I know that I can make a file non executable by setting appropriate permission bits on that file. What I want to do is, making all the files with a certain extension non-executable, So that Nautilus will prompt. The specific extension which I have in my mind is .txt.



In summary, How to instruct Ubuntu not to execute any files with .txt extension?



Note: There is a similar feature in Windows 7 as far as I know.


More From » nautilus

 Answers
4

No file has executable permissions when created unless you changed the default umask settings yourself. You always need to set executable permissions yourself.




What I want to do is, making all the files with a certain extension non-executable, So that Nautilus will prompt.




Nautilus has some options though (in preferences, behaviour, middle set of options):



enter image description here



What this does is check the file you click and check what the file is (by checking the shebang line or the 1st byte of the file) to see if it is an executable and offer to either execute, view or ask what to do with the file you clicked. Text files that have contain text (and not a shebang and/or code) will always open instead of getting executed.



Mind you: this is NOT based on extensions. Extensions are (/should be!) visual aids for us humans; not a way for programs to identify files (an MP3 named music.txt is still an MP3 and not a text file).


[#22686] Wednesday, November 23, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
gliroopy

Total Points: 290
Total Questions: 115
Total Answers: 114

Location: Egypt
Member since Tue, May 3, 2022
2 Years ago
;