LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 01-02-2019, 05:53 AM   #1
Tagiga
Member
 
Registered: Mar 2017
Posts: 37

Rep: Reputation: Disabled
Text files not opening normally


So,

I have quite freshly installed Debian 9 with Mate de.

Text-files i've copied from my old system to the new one
are not behaving correctly.

if i'm trying to double-click open text-file, i get dialog:

Code:
Do you want to run "NAME OF FILE", or display its contents?
"NAME OF FILE" is an executable text file.
Why it doesn't open just by double-click? I need to press Display button.

New files i generate through Pluma are working normally.

How to fix?
 
Old 01-02-2019, 06:07 AM   #2
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by Tagiga View Post
"NAME OF FILE" is an executable text file.
Your copy seems to have switched-on the x (executable) bits on your text files so now the file manager thinks it might be scripts, to be run, instead of text files, to be shown.
Do an "chmod a-x" on all files which are NOT scripts or (compiled) executables (and do NOT do this on directories, they need the x).

This often happens when you copy files from/to a FAT-type file-system, like most memory sticks use, as that fs doesn't have the concept of "executable permission" so unless you got your mount options exactly right everything comes OFF the fs with all x-bits set (so that directories and "real executables" do not loose them).

I mostly mount vfat sticks with the fmask=0133 option so that NO files at all will be executable (but then - of course - would have to restore the x-bits on file I copied that do need them).
But on FAT and (I believe) NTFS executable bits is a all or nothing thing, either all files are executable or none at all.

Last edited by ehartman; 01-02-2019 at 06:08 AM.
 
Old 01-02-2019, 06:07 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,623

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
My first guess, and it is a guess because you have not included NEARLY enough information, is that in copying the files from the older system you changed the permissions. The ownership may also need to be adjusted.

Check the permissions on the files, and turn off the x=executable flag(s). With the exception of shell command (batch) files, text files should NOT be executable.
 
Old 01-02-2019, 06:25 AM   #4
Tagiga
Member
 
Registered: Mar 2017
Posts: 37

Original Poster
Rep: Reputation: Disabled
Ok, thanks for both of you, i think dilemma solved.

Sorry, if provided information was lacking, not very
advanced user yet!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
where are text tools normally applied to? sigint-ninja Linux - Newbie 4 06-04-2015 04:48 AM
hot can make a text browser compatible mior of a sit that isnt normally compatible markyg852 Programming 2 04-14-2009 09:22 AM
real time signals work under gdb, not when run normally?? lel4866 Linux - Networking 10 07-07-2008 01:31 PM
Shell not displaying normally. tehkaao Linux - Software 4 01-10-2008 06:54 AM
Which directory contains files that normally change their size frequently? Simon Adebisi Linux - Software 4 06-28-2005 03:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 09:36 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration