On 07/05/2011 01:09, Rolf Nielsen wrote: > I have two text files, quite extensive ones. They have some lines in > common and some lines are unique to one of the files. The lines that do > exist in both files are not necessarily in the same location. Now I need > to compare the files and output a list of lines that exist in both > files. Is there a simple way to do this? diff? awk? sed? cmp? Or a > combination of two or more of them?
comm(1)
Which does exactly what you want -- showing lines that belong to one
file or another, and lines that belong to both. The limitation is that
the files need to be sorted before being compared.
Cheers,
Matthew
--
Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard
Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: [email protected] Kent, CT11 9PW
signature.asc
Description: OpenPGP digital signature
