[Gllug] How to chmod selectively without writing a script

Liad Bokovsky lbokovsk at akamai.com
Tue Oct 1 14:59:17 UTC 2002


On Tue, Oct 01, 2002 at 03:41:00PM +0100 , Matthew Kirkwood mentioned that:

[SNIP]

>find . -type d -print0 | xargs -0 chmod 755
>find . -type f -print0 | xargs -0 chmod 644
>
noted. thanks.

>However, here a new trick that even old dogs may
>not have seen:
>
>chmod -R u+w,og-w,a+rX .
>
It's ugly, complicated, hard to remember and weird. 
I like it :-)

>It's not directly equivalent, but may actually
>be a better fit.  "+X" does "set the x bit if
>it's already set for anybody".  Unless your
>permissions are badly busted, your directories
>will probably have the x bit set for the owner
>or group.  The above will also open up perms
>on executables, which is useful if it's a build
>tree or similar.
>
>Matthew.

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list