From owner-freebsd-questions@FreeBSD.ORG Wed Sep 12 21:34:34 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE31116A468 for ; Wed, 12 Sep 2007 21:34:34 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from snoogles.rachie.is-a-geek.net (66-230-99-27-cdsl-rb1.nwc.acsalaska.net [66.230.99.27]) by mx1.freebsd.org (Postfix) with ESMTP id A04D413C46E for ; Wed, 12 Sep 2007 21:34:34 +0000 (UTC) (envelope-from fbsd.questions@rachie.is-a-geek.net) Received: from localhost (localhost [127.0.0.1]) by snoogles.rachie.is-a-geek.net (Postfix) with ESMTP id A904D1CCDD for ; Wed, 12 Sep 2007 13:34:33 -0800 (AKDT) From: Mel To: freebsd-questions@freebsd.org Date: Wed, 12 Sep 2007 23:34:31 +0200 User-Agent: KMail/1.9.7 References: <94136a2c0709100856q768b101as96e1e6d16312d374@mail.gmail.com> <200709111315.55658.cblasius@gmail.com> In-Reply-To: <200709111315.55658.cblasius@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709122334.32323.fbsd.questions@rachie.is-a-geek.net> Subject: Re: chmod / files and directories X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Sep 2007 21:34:35 -0000 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