Opening .txt files

Discussion in 'Linux/BSD/Free Systems' started by Deadjasper, Nov 2, 2019.

  1. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,714
    Joined:
    Oct 28, 2001
    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
     
  2. Vermillion

    Vermillion [H]ardness Supreme

    Messages:
    4,112
    Joined:
    Apr 5, 2007
    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.
     
  3. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,714
    Joined:
    Oct 28, 2001
    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:
     
  4. BlueLineSwinger

    BlueLineSwinger Gawd

    Messages:
    676
    Joined:
    Dec 1, 2011
    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
     
  5. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,714
    Joined:
    Oct 28, 2001
    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:
     
  6. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,714
    Joined:
    Oct 28, 2001
    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)
     
  7. Mazzspeed

    Mazzspeed [H]ard|Gawd

    Messages:
    1,915
    Joined:
    Dec 27, 2017
    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.
     
    Deadjasper likes this.
  8. DrLobotomy

    DrLobotomy [H]ardness Supreme

    Messages:
    6,408
    Joined:
    May 19, 2016
    Deadjasper likes this.
  9. ChadD

    ChadD [H]ardness Supreme

    Messages:
    4,207
    Joined:
    Feb 8, 2016
    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
     
    Deadjasper likes this.
  10. Deadjasper

    Deadjasper [H]ard|Gawd

    Messages:
    1,714
    Joined:
    Oct 28, 2001
    Thanks all. Great info. Mucho appreciated.