[lug] Recursive chmod

Chip Atkinson catkinson at circadence.com
Fri May 4 09:18:03 MDT 2001


Find is your friend:

find . -name "*.html" | xargs chmod a-x
or
find . -name "*.html" -exec chmod a-x {} \;

This is run from the directory where you wish to apply the changes.  If 
you wish to apply them to an arbitrary location and down from there, 
replace the . with the location.

Chip

Warren Sanders wrote:

> I need to chmod -R (recursively) using wild card *.html and *.jpg.  My
> problem is it doesn't dive into subdirectories when you use wild cards.
> Is this an all or nothing command?
> 
> I first thought I'd set chmod -R 750 Dir/ which covers all files and
> directories.  Then I wanted to remove the executable from all files which
> are only html and jpg.
> 
> TIA,




More information about the LUG mailing list