Ben Donohue wrote:

> Hi Slugs,
> 
> I'm still working on this but any quick help i'll welcome.
> 
> how do you recursively chmod directories only and not files.
> 
> I want to recursively chmod files to 644 and directories to 755.
> what is the quickest way?
> 
> I thought i'd do the files first and then the dirs as in...
> chmod -R 644 * (for files and directories)
> chmod ??? for directories only?

For the directories use something like:

   find <top level dir> -type d -exec chmod 755 {} \;

and for the files:

   find <top level dir> -type f -exec chmod 755 {} \;

while you are there, you might want to read the find man page ;
find has lots of interesting features.

Erik

-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"C makes it easy to shoot yourself in the foot. C++ makes it 
harder, but when you do, you blow away your whole leg!"
-- Bjarne Stroustrup
-- 
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