From owner-freebsd-questions Mon Jun 3 15: 4:35 2002 Delivered-To: freebsd-questions@freebsd.org Received: from out1.mx.nwbl.wi.voyager.net (out1.mx.nwbl.wi.voyager.net [169.207.3.119]) by hub.freebsd.org (Postfix) with ESMTP id B321537B405 for ; Mon, 3 Jun 2002 15:04:28 -0700 (PDT) Received: from shell.core.com (shell.core.com [169.207.1.89]) by out1.mx.nwbl.wi.voyager.net (8.12.3/8.11.4/1.7) with ESMTP id g53M4SA2025195; Mon, 3 Jun 2002 17:04:28 -0500 Received: from localhost (raiden@localhost) by shell.core.com (8.11.6/8.11.6/1.3) with ESMTP id g53M4Rg18993; Mon, 3 Jun 2002 17:04:27 -0500 (CDT) Date: Mon, 3 Jun 2002 17:04:27 -0500 (CDT) From: Steven Lake X-X-Sender: raiden@shell.core.com To: Ryan Thompson Cc: Steven Lake , Subject: Re: Questions about Chmod In-Reply-To: <20020603155826.B81228-100000@ren.sasknow.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG ah, so it's happily mixing the find command with the chmod command. that works. But that still leaves my first question unanswered. How do I recursively change permissions on only directories without changing the permission on the files in them? On Mon, 3 Jun 2002, Ryan Thompson wrote: > Steven Lake wrote to freebsd-questions@FreeBSD.ORG: > > > I've got two questions about Chmod that I couldn't answer via the > > man pages. Either I'm not reading good enough or the answer isn't there. > > > > 1. Recursive item only changes > > 2. Selective file changes > > > > Ok, the first thing I'm curious of is how to do a recursive chmod > > on say directories only. This also plays into the second question which > > is how do I do a recursive or system wide chmod on only certain files > > based on a variable or name. > > > > So like if I wanted to chmod 755 all > > directories on a system with the name "WWW", > > find(1) will assist you with this. find(1) allows you to apply > commands to each file it matches. So, something like > > chmod 755 `find . -name "WWW" -print` > > Should do the trick. > > > > or with all files containing > > the letters "BLD". > > chmod 755 `find . -name "*BLD*" -print` > > Just be careful out there. It's a big bad filesystem. :-) > > > Hope this helps, > - Ryan > > -- > Ryan Thompson > > SaskNow Technologies - http://www.sasknow.com > 901 1st Avenue North - Saskatoon, SK - S7K 1Y4 > > Tel: 306-664-3600 Fax: 306-664-3630 Saskatoon > Toll-Free: 877-727-5669 (877-SASKNOW) North America > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message