Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 12 Sep 2007 16:55:32 -0500
From:      Erik Osterholm <freebsd-lists-erik@erikosterholm.org>
To:        Mel <fbsd.questions@rachie.is-a-geek.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: chmod / files and directories
Message-ID:  <20070912215532.GB65391@idoru.cepheid.org>
In-Reply-To: <200709122334.32323.fbsd.questions@rachie.is-a-geek.net>
References:  <94136a2c0709100856q768b101as96e1e6d16312d374@mail.gmail.com> <200709111315.55658.cblasius@gmail.com> <200709122334.32323.fbsd.questions@rachie.is-a-geek.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Sep 12, 2007 at 11:34:31PM +0200, 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
> 
> -- 
> Mel

Mel,

According to the man page, using a+X (note the capitalization) should
only set the executable bit on directories, or on files which have any
executable bit set.  A quick test confirms this behavior.  I think
that the combination of the two commands that Zbigniew Komarnicki
listed will result in the desired permissions for the subtree.

Erik



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070912215532.GB65391>