[Gllug] Finding files in one directory only / diff question.

Tom Schutzer-Weissmann trmsw at yahoo.co.uk
Wed Jan 25 08:26:08 UTC 2006


On Tue, 2006-01-24 at 14:30 +0000, Tom Schutzer-Weissmann wrote:
> On Tue, 2006-01-24 at 10:45 +0000, andrew Black wrote:
> > Two related questions
> > 1.  Is there a way of finding out which files exists in a directory a 
> > but not in b. I want to know about some_subdir/only_in_a
> >    a/some_subdir/only_in_a
> >    a/some_other_subdir/in_both     b/some_other_subdir/in_both
> >                                    b/some_subdir/only_in_b
> 
> Maybe you could use "rsync -n --ignore-existing", I've not tried it.

have now... It's not elegant but it's quite flexible:

~$ rsync -r --dry-run --ignore-times --log-format "%n" \
> --ignore-existing A/* Z
some dir or other/
some dir or other/hello Im not in Z

Using --existing instead will list common files and directories, and
--delete will show files that are in Z but not in A:

_$ rsync -r -n -I --log-format "%n" --existing \
> --ignore-existing --delete A/* Z
deleting B/hi Im not in A

bleuh. Use ruby :)

Tom





		
___________________________________________________________ 
Win a BlackBerry device from O2 with Yahoo!. Enter now. http://www.yahoo.co.uk/blackberry
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list