Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jan 2010 11:23:23 -0800
From:      Jason <jhelfman@e-e.com>
To:        Glen Barber <glen.j.barber@gmail.com>
Cc:        "Aryeh M. Friedman" <aryeh.friedman@gmail.com>, freebsd-questions@freebsd.org
Subject:   Re: OT: finding every file not in a list
Message-ID:  <20100127192322.GK43904@eggman.experts-exchange.com>
In-Reply-To: <20100127191737.GA70795@orion.hsd1.pa.comcast.net>
References:  <4B6090FC.4070002@gmail.com> <20100127191737.GA70795@orion.hsd1.pa.comcast.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20100127192322.GK43904>