All txt files now executable

Hi all..
So far, am enjoying Zorin as my day to day distro, very much like that everything just works and am not fighting to make things happen..

But.. seems all my txt files on my system now have the attribute 'Allow executing file as program' ticked on them. Have many years of stuff on my drives, so that means a lot of txt files.

Am not 100% certain that the Zorin has caused this, I did install mousepad text editor straight after the install, not sure if that may have had something to do with it. Found one other post by someone with the same issue, it was not clear what caused it but the solution of right clicking on each fiie and changing the permission is not an option for me, the sun will be a cold lump before I have gone through the 1000's of txt files I have.

Have read about using chmod (please advise if there is something better) to change the attribute of files, I think I could maybe use this to do a system-wide change to all txt files, but before I try this, is there a setting in Zorin somewhere that I could try? Any ideas on how this could have happened?

You can try running:

find "$HOME" -type f -executable -name '*.txt' -execdir chmod a-x {} +

I do not recommend running the command as root, since it will remove executable permission on ALL .txt files it finds.

Hey Aravisian..
Thanks for the response.. What does that command do please? Also, would it be a problem for all txt files to be non-executable? Cant think of any txt files I have that should be executable, maybe you are thinking of some system txt files that have to be executable?

Yes, it is possible that some system files in root may need to be... Without knowing what you have installed, I could not say for sure.
It should be fine for the command to run in the HOME Directory, though. I think if you had ever set up a custom executable file, you would know about it...

It removes the Executable Permission from all .txt files contained in the Home Directory.
find: searches for files of a certain type.
-type f -executable: Look for executable type files, not directories
-name '*.txt': search for only .txt files
-execdir: Uses execdir to ensure that all files are changed, even if you continue working while the command is running.
chmod a-x {} +: Uses the chmod command to change the permissions, in this case, to non-executable. The + means that it will run as many files as possible through the filter simultaneously instead of running each file individually.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.