From owner-freebsd-questions@FreeBSD.ORG Wed Jan 27 19:21:01 2010 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 54FB91065672 for ; Wed, 27 Jan 2010 19:21:01 +0000 (UTC) (envelope-from glen.j.barber@gmail.com) Received: from mail-bw0-f220.google.com (mail-bw0-f220.google.com [209.85.218.220]) by mx1.freebsd.org (Postfix) with ESMTP id CE6458FC15 for ; Wed, 27 Jan 2010 19:21:00 +0000 (UTC) Received: by bwz20 with SMTP id 20so468026bwz.14 for ; Wed, 27 Jan 2010 11:20:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=INYyZu3DYGLPKaW53LQjki/bllPLY6SwuGPWXJvegAg=; b=oJdR7ACsVV7o3k/HXW7upAe140fhCQYFNA3vrP7gUNYLoLq/doWf0h+dRwthbMuuGV xGU8pKNBjnv2b8MifkpoSA+jaemi481FbUuY1LqXXHW9bDa4rhcZ/n+xU4MpVZvirPvi ReXloj7oPa9rODmeoZ4cb30T6xy6FRZimItwE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=G0UqmTgbsV8M+wcG+ZWbfrxAEksElagwu46Znsoq85/xFK+13DceFzBuOdzBzseK47 dUlpWNGHczZw3NTSxJQRcUgsAGxSAZyOFDqJDPNicKqQOTD3Jt2hWjLMrVJaX1cH+Gbn ZzaZdfloia3hOitQ30uOBWWXYaMTiJjetfsQs= Received: by 10.102.14.13 with SMTP id 13mr4912255mun.32.1264620058137; Wed, 27 Jan 2010 11:20:58 -0800 (PST) Received: from orion.hsd1.pa.comcast.net (c-71-230-240-241.hsd1.pa.comcast.net [71.230.240.241]) by mx.google.com with ESMTPS id s11sm962829mue.34.2010.01.27.11.20.56 (version=SSLv3 cipher=RC4-MD5); Wed, 27 Jan 2010 11:20:56 -0800 (PST) Date: Wed, 27 Jan 2010 14:17:37 -0500 From: Glen Barber To: "Aryeh M. Friedman" Message-ID: <20100127191737.GA70795@orion.hsd1.pa.comcast.net> References: <4B6090FC.4070002@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4B6090FC.4070002@gmail.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-questions@freebsd.org Subject: Re: OT: finding every file not in a list 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, 27 Jan 2010 19:21:01 -0000 Hi, Aryeh M. Friedman wrote: > I have a list of files that should be in a dir tree and want to remove > any files from the tree not in list (i.e. if it is on the list keep it > else rm it)... any quick way to do this? Perhaps something like this will help: find /dir -type f | \ grep -v `cat excludelist` | \ xargs rm Regards, -- Glen Barber