chmod / files and directories

Pollywog lists-fbsd at shadypond.com
Mon Sep 10 10:18:22 PDT 2007


On Monday 10 September 2007 16:31:35 Shantanoo Mahajan wrote:
> On 10-Sep-07, at 9:40 PM, Daniel Bye wrote:
> > On Mon, Sep 10, 2007 at 05:06:07PM +0100, Daniel Bye wrote:
> >> On Mon, Sep 10, 2007 at 05:56:12PM +0200, 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!
> >
> > Sorry, that *should* have been:
> >
> >   # find /usr/local/www/data/wp -type d -exec chmod 755 {} \;
> >   # find /usr/local/www/data/wp -type f -exec chmod 644 {} \;
>
> # find /usr/local/www/data/wp -type f -exec chmod 644 '{}' \;
> # find /usr/local/www/data/wp -type d -exec chmod 755 '{}' \;

Why the single quotes around the {}  ?  I don't think I have seen that before 
and I want to understand it before I save it in my notes.  I have often 
wanted to perform the same task but I did not know if there was a way.


More information about the freebsd-questions mailing list