Re: OT: finding every file not in a list

2010-01-28 Thread Chad Perrin
On Wed, Jan 27, 2010 at 02:16:12PM -0500, 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? You should probably use a shell command as

Re: OT: finding every file not in a list

2010-01-28 Thread Chad Perrin
On Thu, Jan 28, 2010 at 03:13:51AM -0700, Chad Perrin wrote: losers= Dir[#{Dir.getwd}/**/*] keepers = IO.readlines ARGV.shift startpath = ARGV.shift if startpath Dir.chdir startpath end Oops. Speaking of using at your own risk . . . That line that reads

Re: OT: finding every file not in a list

2010-01-28 Thread CyberLeo Kitsana
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/ # find old old old/a old/a/1 old/a/4 old/b old/b/2 old/b/5 old/c

Re: OT: finding every file not in a list

2010-01-28 Thread David Kelly
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/ [...]

Re: OT: finding every file not in a list

2010-01-27 Thread Glen Barber
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 | \

Re: OT: finding every file not in a list

2010-01-27 Thread Jason
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

Re: OT: finding every file not in a list

2010-01-27 Thread Aryeh M. Friedman
Glen Barber wrote: 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:

Re: OT: finding every file not in a list

2010-01-27 Thread Bill Campbell
On Wed, Jan 27, 2010, 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? One way to do this that I use quite frequently uses the comm