chmod / files and directories

Philip M. Gollucci philip at ridecharge.com
Mon Sep 10 09:28:18 PDT 2007


Zbigniew Szalbot wrote:
> Hello,
> 
> I did read man chmod but I am not really wiser. Is there an option to
> recursively set 755 permissions for directories and 644 for files?
> When I just issue
> chmod -R 755 /usr/local/www/data/wp/
> then all files and directories under wp/ are given permissions 755
> which is not what I want.
> I can do it manually but since there are manyt subdirectories I
> thought I would make my life easier. Many thanks in advance!
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

You could also probably use mtree but you'd need to make the config file
first.

-- 
------------------------------------------------------------------------
Philip M. Gollucci (philip at riderway.com) 323.219.4708
Senior System Admin - Riderway, Inc. http://riderway.com
1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB  B89E 1324 9B4F EC88 A0BF

Work like you don't need the money,
love like you'll never get hurt,
and dance like nobody's watching.



More information about the freebsd-questions mailing list