Opening .txt files

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
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
 

Vermillion

Supreme [H]ardness
Joined
Apr 5, 2007
Messages
4,234
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.
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
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:
 
Joined
Dec 1, 2011
Messages
988
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
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
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:
 

Deadjasper

[H]ard|Gawd
Joined
Oct 28, 2001
Messages
1,917
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)
 

Mazzspeed

2[H]4U
Joined
Dec 27, 2017
Messages
2,880
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.
 

ChadD

Supreme [H]ardness
Joined
Feb 8, 2016
Messages
5,152
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
 
Top