*BSD News Article 26708


Return to BSD News archive

Newsgroups: comp.os.386bsd.questions
Path: sserve!newshost.anu.edu.au!munnari.oz.au!constellation!paladin.american.edu!howland.reston.ans.net!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!decwrl!netcomsv!netcomsv!resonex!zenon
From: zenon@resonex.com (Zenon Fortuna)
Subject: Re: How to find identical lines in multiple files?
Message-ID: <1994Jan31.131709.7958@resonex.com>
Organization: Resonex Inc., Fremont CA
References: <2iihjj$52p@sylvester.cc.utexas.edu>
Date: Mon, 31 Jan 1994 13:17:09 GMT
Lines: 21

In article <2iihjj$52p@sylvester.cc.utexas.edu> vax@sylvester.cc.utexas.edu (Vax) writes:
>I just posted this to c.u.q and didn't get a reply.
>
>What is the best way to find identical lines in two or more files?
>It is acceptable to sort the files first.
>
>Surely there is some option to diff, cmp, or grep to do this!
>Isn't there?
>
>(I was unable to find any.)
>
>I have read the c.u.q. FAQ, et. al., and have had no luck with other routes.
>Thanks.
>-- 
>Protect our endangered bandwidth - reply by email.  NO BIG SIGS!
>VaX#n8 vax@ccwf.cc.utexas.edu - Don't blame me if the finger daemon is down

There should be a comm(1) utility which - between other actions - can print
lines common to two files:

	comm -12 file1 file2