OT: finding every file not in a list

Jason jhelfman at e-e.com
Wed Jan 27 19:24:49 UTC 2010


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 at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"
>


More information about the freebsd-questions mailing list