diff: find common files in two directory trees
diff -r -s jag jag.old | grep identical > junk.jagident &
lists all files that are identical in two directory trees
jag, jag.old.
This perl script removes all identical files from jag.old:
#!/usr/bin/perl
#diff -r -s jag jag.old | grep identical > junk.jagident &
open(FILE,"< junk.jagident");
while () {
$line = $_;
$line =~ s/\bFiles\b//g;
$line =~ s/\band\b//g;
$line =~ s/\bare identical\b//g;
$line =~ s/\bjag\/\S*\b//g;
`/bin/rm -f $line`;
print $line;
}
ls -lR jag.old
lists all files that are not identical.