in reply to Comparing Large Files

If you find that 'diff' style solutions are choking on the sheer size of the file, and you can get away with sorting, I suggest doing that. You may be able to tweak something like gnu diff to work, or some perl diff solution, eventually, but I haven't had good luck doing similar things.

A decent 'sort' command should work reasonably quickly, but you may need to send the temporary files to another directory (gnutar has '-T' for this). I've sorted a file over a GB in size with over 6 million lines in less than an hour on a reasonable AIX box (probably more like half an hour) to do something similar. It shouldn't be hard to write something similar to comm.

FWIW, if you really must maintain ordering I'd suggest rewriting the file with line numbers appended to each line, and then using sort and ignoring line numbers during the 'comm' phase. You can reconstruct the original line ordering from the appended line numbers.

Update: s/conn/comm/

bluto