I have two big files (6GB each). They are unsorted, with linefeeds (\n) as separators. How can I diff them? It should take under 24h.
|
|
||||
|
|
|
The most obvious answer is just to use the diff command and it is probably a good idea to add the --speed-large-files parameter to it.
You mention unsorted files so maybe you need to sort the files first
you could save creating an extra output file by piping the 2nd sort output direct into diff
Obviously these will run best on a system with plenty of available memory and you will likely need plenty of free disk space too. It wasn't clear from your question whether you have tried these before. If so then it would be helpful to know what went wrong (took too long etc.). I have always found that the stock sort and diff commands tend to do at least as well as custom commands unless there are some very domain specific properties of the files that make it possible to do things differently. |
|||||||||||||
|
|
Sorting the inputs and telling the |
|||
|
|