Opening .txt files

Deadjasper

2[H]4U
Joined
Oct 28, 2001
Messages
2,568
Is there any way to make Linux open .txt files in text Editor by default instead of asking whether to open or run it?

TIA
 
Is there any way to make Linux open .txt files in text Editor by default instead of asking whether to open or run it?

TIA

Yeah just like windows you can right click and open with and check to make it default. Some DEs allow you to set the defaults for many file types too.
 
Thanks. Text Editor is already the default and I still get the dialog -

Screenshot from 2019-11-02 18-44-16.png


None of my text files are executables nor have they ever been. :confused:
 
Seems that they are marked as executable by the file system. What is the result if you run:
Code:
ls -l /path/to/file.txt


Try running:
Code:
chmod -x /path/to/file.txt
 
Shit. No matter how I type the F@cking path I get "No such file or Directory"

Anyway, I removed the .txt and it opened normally. I did this to several .txt files and they all did the same Guess I'll remove .txt from files as needed. Windows gives a warning when you remove an extension, Linux doesn't, at least not for .txt files. :confused:
 
Found the solution. There's a setting in Nemo - "View Executable Text Files When Opened" selected this and problem solved.

Thanks guys for the help. (y)
 
Understand that Linux isn't as dependent on extensions as Windows. Which is a good thing as double extension exploits under Windows are a massive issue that has never been rectified.
 
Understand that Linux isn't as dependent on extensions as Windows. Which is a good thing as double extension exploits under Windows are a massive issue that has never been rectified.

Decent article explaining files in Linux/Unix.

A file is a file is a file.....

https://www.tecmint.com/explanation-of-everything-is-a-file-and-types-of-files-in-linux/

Always a good idea to read a basic file info type post when you come to Linux. Windows has people trained to perform some very sketchy file management. Linux file systems... and permissions are not that complicated once you been using them for awhile.

http://linuxcommand.org/lc3_lts0090.php

I would read about permissions as well if you haven't already. Handy to understand what chmod 755 or 700 ect are doing exactly. Its very logical really... and so much easier to understand and use then the mess MS has going.

One of the biggest security flaws for windows is the extension crap. Don't trust any file is what it says it is cause it has a .xxx on the end. MS has gotten a better over the years in regards to reading meta data... still a lot of windows software that just assumes, what ever .xxx is atttached is legit and hey open it run it give it the keys. Anyway ya windows is more secure then Win 95 days with file extensions... still those .com/.exe files in emails sent to your grand folks with ".jpg" extensions are still more a thing then they should be. lol
 
Back
Top