From owner-freebsd-questions@FreeBSD.ORG Mon Sep 10 17:18:22 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 2F04C16A41A for ; Mon, 10 Sep 2007 17:18:22 +0000 (UTC) (envelope-from lists-fbsd@shadypond.com) Received: from mx-outbound01.easydns.com (mailout.easydns.com [205.210.42.54]) by mx1.freebsd.org (Postfix) with ESMTP id DC44013C4A3 for ; Mon, 10 Sep 2007 17:18:21 +0000 (UTC) (envelope-from lists-fbsd@shadypond.com) Received: from slider.shadypond.com (69-12-173-117.static.humboldt1.com [69.12.173.117]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx-outbound01.easydns.com (Postfix) with ESMTP id 0145181E1 for ; Mon, 10 Sep 2007 13:18:19 -0400 (EDT) Received: from slider.shadypond.com (slider.shadypond.com [192.168.1.11]) by slider.shadypond.com (postoffice) with ESMTP id 7B7B8B65A3 for ; Mon, 10 Sep 2007 17:18:17 +0000 (UTC) From: Pollywog To: freebsd-questions@freebsd.org Date: Mon, 10 Sep 2007 17:18:16 +0000 References: <94136a2c0709100856q768b101as96e1e6d16312d374@mail.gmail.com> <20070910161006.GB20159@catflap.slightlystrange.org> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200709101718.16467.lists-fbsd@shadypond.com> 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: Mon, 10 Sep 2007 17:18:22 -0000 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.