From owner-freebsd-questions@FreeBSD.ORG Wed May 7 12:36:35 2008 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 6C1721065675 for ; Wed, 7 May 2008 12:36:35 +0000 (UTC) (envelope-from jonathan@hst.org.za) Received: from hermes.hst.org.za (onix.hst.org.za [209.203.2.133]) by mx1.freebsd.org (Postfix) with ESMTP id 85C8C8FC23 for ; Wed, 7 May 2008 12:36:33 +0000 (UTC) (envelope-from jonathan@hst.org.za) Received: from sysadmin.hst.org.za (sysadmin.int.dbn.hst.org.za [10.1.1.20]) (authenticated bits=0) by hermes.hst.org.za (8.13.8/8.13.8) with ESMTP id m47CZ56b076150 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Wed, 7 May 2008 14:35:05 +0200 (SAST) (envelope-from jonathan@hst.org.za) From: Jonathan McKeown Organization: Health Systems Trust To: freebsd-questions@freebsd.org Date: Wed, 7 May 2008 14:38:40 +0200 User-Agent: KMail/1.7.2 References: <482198FA.8070708@lc-words.com> In-Reply-To: <482198FA.8070708@lc-words.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200805071438.40372.jonathan@hst.org.za> X-Spam-Score: -4.399 () ALL_TRUSTED,BAYES_00 X-Scanned-By: MIMEDefang 2.61 on 209.203.2.133 Subject: Re: chmod operation on directories / files 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, 07 May 2008 12:36:35 -0000 On Wednesday 07 May 2008 13:56, Zbigniew Szalbot wrote: > How do I chmod separately files and directories? > > If I use chmod -R 644 then it will go through all the subdirectories > assigning everything 644 permissions, directories including. Use the symbolic form for permissions and use X, which is true if any of the execute bits is currently set, or if the argument is a directory. chmod -R =r,u+w,+X . (set read for all, add user write, add all execute bits if required) should give you 644 on files, 755 on directories and executables. Jonathan