Here a simple problem to solve. I read up on this, tried the chmod command several times, and then went and found some samples of it use but something is still not connecting with me.
My problem / question;
I want to set a file permission so that Linux will not think it is an executable file. When I go to edit a file, I get this message.
When I do a ls -l on the file it looks like this;
-rw-r–r-- 1 easyt50 easyt50 1252 May 17 23:55 East_to_West.txt
The ‘x’ for execute is not set as you can see. This problem is from almost all files that came from windows. If I create a new file in Linux, the execute flag is not set.
easyt50@X220:~/test$ ls -l
total 4
-rw-rw-r-- 1 easyt50 easyt50 21 Aug 16 16:10 t-file.txt
Oh, file was the command, I read it as ‘the file’.
As requested;
Z_Misc$ file East_to_West.txt
East_to_West.txt: ASCII text, with CRLF line terminators
if you right-click on the file and look at the properties, is there a field labeled “open with” or something similar? if so, what is it set to for .txt files?
text editor is what i would expect, but was thinking it might have gotten set to something different. if you change that to LibreOffice Writer, do you still get the same question about executing it when you try to open it? also, do you get the question about executing it when you double-click on the file name or icon?
my 19.3 vm is set to “ask everytime”, but xed opens a test file every time. that file is just “ascii text” though. i am wondering if for whatever reason
is being misinterpreted as executable. i haven’t worked with any windows text files in a while.
@01101111, if I right click and open with LibreOffice then no pop up screen asking the question and it goes straight to edit. It’s strange, but if I right click and open with text editor, again no question.
@abhishek, you are right! It is set to “Ask everytime”. Changing it to “View executable text files when they are open” seems to be a great work around / solution. Tho it does not explain why a text file from Windows vs a text file from Linux are treated differently. I do not get the pop up screen from text files created in Linux leaving the editor option unchanged.