All my files, from Windows, are executable

Hi Manjaro forum,

All my files (jpg, docs, txt, pdf etc) that I have copied from my windows harddrive, are marked as executable.

Why is this happening and is it safe to remove the executable attribute from all my files?

Yours,
MonkeyBoy

NTFS doesn’t understand Linux permissions.

3 Likes

Thanks for the answer zbe.
Is it safe to remove the executable attribute from all my files?

Sure, why not. You can add it back 5 minutes later if you wish so. :stuck_out_tongue:

So it has no negative effect on my files?

What kind of negative effect can any permission or lack of have on the content of a file?

Why not just leave it alone?

Misread. I thought you meant files mounted via NTFS.

In your case, it’s no problem to recursively remove the executable permission from all those files.

zbe: I do not know. So that is why I am asking.
winnie: I could leave it alone, if it does not have any negative effect.

Well, I suggest you read what permissions are for and how do they work.

Thanks winnie. I will try to recursively remove the executable permission from all my files…somehow :slight_smile:

Well zbe, that seems like a good idea.

Hope you don’t expect us to feed you basic commands. You are supposed to understand things like permissions fairly well since you are not using a beginner distro.

Well … if people think my question is below them, nobody is forcing them to answer it. I am really not supposed to anything.
So if some people, dont like it, they can move on.

1 Like

You got the answer. (Even though you could just type it into google)

You got this in reverse. It’s seems it’s below you to do some learning on your own.

bye bye zbe…

1 Like

Yes - data files should never have the exec bit set.

But - before you venture into a chmod -x folder -R yo need to understandt that folders need the exec bit to allow navigating the folder.

Ensure you are executing this inside the top folder containing the files and folders you copied

You may need - to set the owner and group - $USER:$USER is an environment variable holding your current user:group example monkyboy:monkeyboy. If the files are copied from a mix of unknown users - below command can be executed with sudo -

WARNING never do this in a system folder e.g. /. Always limit to files and folders you have write access to - thus ONLY inside your $HOME

chown -R $USER:$USER
find . -type f | sudo xargs -d'\n' chmod 664  # file permisson to rw for user and group and ro for other
find . -type d | sudo xargs -d'\n' chmod 775  # folder permission to rw for user and group and ro for other
find . -type d | sudo xargs -d'\n' chmod +s   # set defaults for new files in a folder to inherit the folder permission
1 Like

Thanks for the answer linux-aarhus. :slightly_smiling_face:

I don’t recall this was ever an issue on GNU/Linux Mint. Do they have some tool/script/whatever that seamlessly handle this behind the scenes maybe…? Perhaps something like (pseudo code):

if drive.filesystem == 'NTFS' then
    system.copyfile(FILE);
    system.set_flags(FILE, '-x');

I also remember I had to set the x flag on files such as .exe (I used to run Wine) after copying them from old storage.
Or my memory plays tricks on me…blame old age, I’m probably older than most here. (o_o)

You can just mount ntfs drive with options a la -o uid=1000,gid=1000,fmask=133,dmask=022 and you have everything sorted.

1 Like