From owner-freebsd-questions Fri May 10 06:16:29 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id GAA15178 for questions-outgoing; Fri, 10 May 1996 06:16:29 -0700 (PDT) Received: from apollo.is.co.za (apollo.is.co.za [196.4.160.2]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id GAA15172 for ; Fri, 10 May 1996 06:16:24 -0700 (PDT) Received: from admin.is.co.za (admin.is.co.za [196.23.0.9]) by apollo.is.co.za (8.7.5/8.7.5/IShub#2) with ESMTP id PAA02753; Fri, 10 May 1996 15:16:18 +0200 (GMT) Received: (from robin@localhost) by admin.is.co.za (8.7.5/8.7.5/ISsubsidiary#1) id PAA00755; Fri, 10 May 1996 15:16:16 +0200 (GMT) From: Robin Lunn Message-Id: <199605101316.PAA00755@admin.is.co.za> Subject: Re: running gag: chmod -R .\* To: mac@nibsc.ac.uk Date: Fri, 10 May 1996 15:16:15 +0200 (GMT) Cc: robin@is.co.za, garth@dogbert.systems.sa.gov.au, questions@freefall.freebsd.org In-Reply-To: <199605101301.OAA17256@chalsig.nibsc.ac.uk> from "mac@nibsc.ac.uk" at May 10, 96 02:01:38 pm X-Organisation: The Internet Solution (Pty) Ltd. X-Phone: +27-11-4475566; Fax: +27-11-4475567 Reply-To: robin@is.co.za X-AIDAT-Member: See http://www.aidat.org X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-questions@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk mac@nibsc.ac.uk wrote: > >find . -type f -exec chmod 0644 {} \; > > > >This finds all files and ignores directories like .. and such. It doesn't > >depend on any shell either. > > [Misses device specials etc. maybe a good thing, but we're here for the total > solution] Just add a "-a type X" where X is the type you also want changed. The find command is really not that hard. `man find` If you only want to miss directories then: find . '!' -type d -exec chmod 644 {} \; > Which all brings me to my final thought. Given that '-R' is smart about .files > in subdirectories listed on the command line, we can use this:- > > chmod -R 0644 . > > as a replacement for the otherwise excellent ls -A | xargs chmod That changes directory permissions... Directories with 644 permissions aren't that popular, but thats a matter of taste. -- _ __ | Only my ideas here unless I say otherwise... ' ) ) / | (BeamJack@IRC) /--' ____/___o __ | "Nondum amabam, et amare amabam... quaerebam / \_(_) /_) (__/) )_ | quid amarem, amans amare." - St Augustine