banner
Previous Page
PCLinuxOS Magazine
PCLinuxOS
Article List
Disclaimer
Next Page

Tip Top Tips: Mass Removal Of The Executable Attribute From Files


Editor's Note: Tip Top Tips is a monthly column in The PCLinuxOS Magazine. Each month, we will feature -- and possibly even expand upon -- one tip from the PCLinuxOS forum. The magazine will not accept independent tip submissions specifically intended for inclusion in the Tip Top Tips column. Rather, if you have a tip, share it in the PCLinuxOS forum's "Tips & Tricks" section. Your tip just may be selected for publication in The PCLinuxOS Magazine.

This month's tip comes from PCLinuxOS forum member dm+.

I have lots of files coming from DOS/FAT/NTFS etc. filesystems which are marked with the 'executable' attribute.



The following command will process the file system sub-tree starting at the current directory and will remove the 'executable' attribute from all files (in filesystems where this is supported, like ext2, ext2, ext4).

find . -type f -print -exec chmod -x "{}" ';'

Note that if you remove the 'executable' attribute from a folder (directory) entry, the folder is no longer accessible. The above command will only affect 'regular' files (-type f option).

pags added:

Bear in mind this is not changing the files while they are still on the DOS/FAT/NTFS etc. filesystems. This is after they've been moved to a filesystem that supports the attributes (ext2/3/4, btrfs, jfs, xfs, etc… ).



Previous Page              Top              Next Page