On Mon, 06 Sep 2004 20:13:23 +1000
Andrewd <[EMAIL PROTECTED]> wrote:

> I have a bunch of files I need to chmod. All files exist under a main
> directory and also under sub directories (of the main). I know I can
> chmod 666 *.php but I need to do that in each directory. How do I tell
> it to go thru each sub directory and change the files
> 

Like Jeff said you probably don't want to do this; really.

To make them group-writeable and world-readable do:

       find . -name \*.php -exec chmod g=wr,o=r {} \;

this will probably be wasted unless you fix the dirs as well:

       find . -type f -exec chmod g=rwx,o=rx {} \;

If you want to the whole tree, dirs and every file, then
a recursive chmod is ok:

       chmod -R g+rwX,o+rX .

This uses the magic X, which means make it executable for
others and group if it's executable (searchable) for owner.


--
Matt


-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to