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
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
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
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/
[...]
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 | \
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
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:
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