chmod / files and directories

Mel fbsd.questions at rachie.is-a-geek.net
Wed Sep 12 14:46:16 PDT 2007


On Wednesday 12 September 2007 23:34:31 Mel wrote:
> On Tuesday 11 September 2007 13:15:55 Zbigniew Komarnicki wrote:
> > On Monday 10 of September 2007 17:56:12 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.
> >
> > Maybe also in such way:
> > # find /usr/local/www/data/wp -type f -exec chmod 644 {} \;
> > # chmod -R a+X /usr/local/www/data/wp
>
> That's the equivalent of chmod -R 755, since it sets exec bit on
> everything. Assuming all directories are already executable and files are
> not, the shortcut would be:
> chmod -R o+w,go-w,a+r /usr/local/www/data/wp

Naturally that's u+w.

I shall proofread before pressing send.

-- 
Mel


More information about the freebsd-questions mailing list