From owner-freebsd-questions@FreeBSD.ORG Sat Nov 22 05:31:42 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F032116A4CE for ; Sat, 22 Nov 2003 05:31:42 -0800 (PST) Received: from munk.nu (mail.munk.nu [213.152.51.194]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23FAE43FD7 for ; Sat, 22 Nov 2003 05:31:40 -0800 (PST) (envelope-from munk@munk.nu) Received: from munk by munk.nu with local (Exim 4.24; FreeBSD) id 1ANXrP-000BSx-GN for freebsd-questions@freebsd.org; Sat, 22 Nov 2003 13:31:39 +0000 Date: Sat, 22 Nov 2003 13:31:39 +0000 From: Jez Hancock To: freebsd-questions@freebsd.org Message-ID: <20031122133139.GB43100@users.munk.nu> Mail-Followup-To: freebsd-questions@freebsd.org References: <3FBF5E71.8050809@hotmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3FBF5E71.8050809@hotmail.com> User-Agent: Mutt/1.4.1i Sender: User Munk Subject: Re: newbie: to pipe the result of a program as commandline parameter for another. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2003 13:31:43 -0000 On Sat, Nov 22, 2003 at 09:02:41PM +0800, Zhang Weiwu wrote: > Hello. I just checkouted a big program. What I want to do is to remove > all CVS/ folders from the hierarchy. > > There might be other ways to do so (give me a hint?). What I can think > of is to run find(1) to find out all CVS folders, and pass them as > parameters of rm(1), but I don't know how to do so. find . -name "CVS" -type d would find all directories named CVS under the current dir. Once you're happy with the directories it finds you could pipe the results to xargs: find . -name "CVS" -type d | xargs rm -rf -- Jez Hancock - System Administrator / PHP Developer http://munk.nu/