From owner-freebsd-questions@FreeBSD.ORG Wed Jan 27 19:24:49 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 B17281065670 for ; Wed, 27 Jan 2010 19:24:49 +0000 (UTC) (envelope-from jhelfman@e-e.com) Received: from mail.experts-exchange.com (mail.experts-exchange.com [64.156.132.251]) by mx1.freebsd.org (Postfix) with ESMTP id 99EA88FC18 for ; Wed, 27 Jan 2010 19:24:49 +0000 (UTC) Received: from eggman.experts-exchange.com (unknown [72.29.180.81]) by mail.experts-exchange.com (Postfix) with ESMTP id 2EA824A2E70E; Wed, 27 Jan 2010 11:13:37 -0800 (PST) Received: by eggman.experts-exchange.com (sSMTP sendmail emulation); Wed, 27 Jan 2010 11:23:23 -0800 Date: Wed, 27 Jan 2010 11:23:23 -0800 From: Jason To: Glen Barber Message-ID: <20100127192322.GK43904@eggman.experts-exchange.com> References: <4B6090FC.4070002@gmail.com> <20100127191737.GA70795@orion.hsd1.pa.comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20100127191737.GA70795@orion.hsd1.pa.comcast.net> X-Operating-System: FreeBSD 7.2-RELEASE-p4 X-Living-The-Dream: I love the SLO Life! User-Agent: Mutt/1.5.20 (2009-06-14) Cc: "Aryeh M. Friedman" , 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:24:49 -0000 You could probably use rsync with : --exclude-from=FILE read exclude patterns from FILE -jgh On Wed, Jan 27, 2010 at 02:17:37PM -0500, Glen Barber thus spake: >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 >_______________________________________________ >freebsd-questions@freebsd.org mailing list >http://lists.freebsd.org/mailman/listinfo/freebsd-questions >To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" >