[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sheflug] php script to list files and sub folders recursively



On Fri, 2004-06-25 at 15:06, Jonathan wrote:
> > What about
> > % cd <requiredfolder>
> > % chmod 700 .
> > % find . -name '*' -exec chmod 700 {} \;
> What's wrong with "chmod -R 700 /path/to/folder" ??

Both could be considered bad practice under Unix, because it'd set
execute permissions on the files as well as the directory. This may not
be requested, or even strictly a good idea.

cd $dir
find . -type d -exec chmod 700 {} \;

Will do the job nicely. And you don't need to chmod 700 ., because with
find . it'll find '.' in the list of files. So it'll already set that to
mode 700. You can verify this with -v.

-- 
nine                              <e> rob [at] impure.org.uk <pgp> 0x8bb5c71e
                "This Basil. This Basil's hand. This smack on the head."

___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.