Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 May 2011 02:49:58 +0200
From:      Rolf Nielsen <listreader@lazlarlyricon.com>
To:        Polytropon <freebsd@edvax.de>
Cc:        FreeBSD <freebsd-questions@freebsd.org>
Subject:   Re: Comparing two lists
Message-ID:  <4DC49736.1090909@lazlarlyricon.com>
In-Reply-To: <20110507023325.6be436ec.freebsd@edvax.de>
References:  <4DC48DB6.8030907@lazlarlyricon.com> <20110507023325.6be436ec.freebsd@edvax.de>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
2011-05-07 02:33, Polytropon skrev:
> On Sat, 07 May 2011 02:09:26 +0200, Rolf Nielsen<listreader@lazlarlyricon.com>  wrote:
>> Hello all,
>>
>> 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?
>
> I would suggest using a combination of sort, uniq and diff.
> Those are base system tools.
>
>

Ah. I didn't know about uniq. That sure helped. :)
Thanks.



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4DC49736.1090909>