I recommend using find in combination with xargs instead of -exec.  Like
this:

    find <root-dir> -type f -print | xargs chmod 644 
    find <root-dir> -type d -print | xargs chmod 755

The difference is it doesn't create a separate chmod process for each and
every file and directory.  Running find with -exec on a large directory tree
(i.e. containing many files) can put a surprising load on the system.


"Skuse, Phil" <[EMAIL PROTECTED]> writes:

> how about
> 
> find <root-dir> -type f -exec chmod 644 {} \;
> find <root-dir> -type d -exec chmod 755 {} \;
> 
> 
> -----Original Message-----
> From: Gordon McDowall [mailto:[EMAIL PROTECTED]]
> Sent: 04 September 2002 11:18
> To: '[EMAIL PROTECTED]'
> Subject: file - directory permissions
> 
> 
> Hi
> 
> We run a few virtual web servers and often get people who have changed the
> permissions of many of the directories and files within their website root
> directory.   Has anyone ever seen/written a script that would reset the
> permissions on everything below their root directory ie files to 644 but
> directories to something different etc.
> Any help appreciated
> 
> Gordon
> 
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 
> 
> 
> -- 
> redhat-list mailing list
> unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
> https://listman.redhat.com/mailman/listinfo/redhat-list
> 

-- 
tim writer <[EMAIL PROTECTED]>                                  starnix inc.
tollfree: 1-87-pro-linux                        thornhill, ontario, canada
http://www.starnix.com              professional linux services & products



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to