[Novalug] Diff for directories?

Richard Rognlie rrognlie at gamerz.net
Thu Aug 7 11:41:54 EDT 2008


On Thu, Aug 07, 2008 at 11:38:23AM -0400, Nick Danger wrote:
> I have two external HDs. Both are holding a large (60gig+) collection of 
> music files. Somehow I got them out of sync, and each side has a few 
> zero byte files. They differ from drive to drive so I cant just do a 
> bulk copy from one to the other. Is there a diff command for 
> directories? So I can find which files are zero on one side but not on 
> the other? Short of writing some shell/perl, I can't think of anything 
> really easy one command line type.

cd $DIR1; find . -type f -size 0 | sort >/tmp/dir1
cd $DIR2; find . -type f -size 0 | sort >/tmp/dir2
diff /tmp/dir[12]

-- 
 /  \__  | Richard Rognlie / Sendmail Ninja / Gamerz.NET Lackey
 \__/  \ | http://www.gamerz.net/~rrognlie    <rrognlie at gamerz.net>
 /  \__/ | Creator of pbmserv at gamerz.net
 \__/    |                Helping reduce world productivity since 1994



More information about the Novalug mailing list