From owner-freebsd-questions@FreeBSD.ORG Fri Jan 29 02:40:05 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 00C521065676 for ; Fri, 29 Jan 2010 02:40:04 +0000 (UTC) (envelope-from dkelly@hiwaay.net) Received: from bee.hiwaay.net (bee.hiwaay.net [216.180.54.11]) by mx1.freebsd.org (Postfix) with ESMTP id AEE188FC14 for ; Fri, 29 Jan 2010 02:40:04 +0000 (UTC) Received: from [10.0.0.9] (dynamic-24-42-224-110.knology.net [24.42.224.110] (may be forged)) (authenticated bits=0) by bee.hiwaay.net (8.13.8/8.13.8) with ESMTP id o0T2e1Kh1563650 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NO); Thu, 28 Jan 2010 20:40:02 -0600 (CST) References: <4B6090FC.4070002@gmail.com> <4B620E5E.2040908@cyberleo.net> In-Reply-To: <4B620E5E.2040908@cyberleo.net> Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii Message-Id: <08A06102-454D-4E82-8447-F2170978972D@hiwaay.net> Content-Transfer-Encoding: 7bit From: David Kelly Date: Thu, 28 Jan 2010 20:40:13 -0600 To: CyberLeo Kitsana X-Mailer: Apple Mail (2.1077) 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 Reply-To: questions@freebsd.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Jan 2010 02:40:05 -0000 On Jan 28, 2010, at 4:23 PM, CyberLeo Kitsana wrote: > 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? > > # ls -1F > keep > old/ [...] I think mtree(8) is the proper tool for this job. Especially the -r option: -r Remove any files in the file hierarchy that are not described in the specification. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.