From owner-freebsd-questions@FreeBSD.ORG Sat May 7 00:33:27 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F1601065670 for ; Sat, 7 May 2011 00:33:27 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de (mx01.qsc.de [213.148.129.14]) by mx1.freebsd.org (Postfix) with ESMTP id 328D38FC1E for ; Sat, 7 May 2011 00:33:27 +0000 (UTC) Received: from r55.edvax.de (port-92-195-63-204.dynamic.qsc.de [92.195.63.204]) by mx01.qsc.de (Postfix) with ESMTP id 6F6DF3D4ED; Sat, 7 May 2011 02:33:26 +0200 (CEST) Received: from r55.edvax.de (localhost [127.0.0.1]) by r55.edvax.de (8.14.2/8.14.2) with SMTP id p470XPBl003628; Sat, 7 May 2011 02:33:25 +0200 (CEST) (envelope-from freebsd@edvax.de) Date: Sat, 7 May 2011 02:33:25 +0200 From: Polytropon To: Rolf Nielsen Message-Id: <20110507023325.6be436ec.freebsd@edvax.de> In-Reply-To: <4DC48DB6.8030907@lazlarlyricon.com> References: <4DC48DB6.8030907@lazlarlyricon.com> Organization: EDVAX X-Mailer: Sylpheed 2.4.7 (GTK+ 2.12.1; i386-portbld-freebsd7.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: FreeBSD Subject: Re: Comparing two lists X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 00:33:27 -0000 On Sat, 07 May 2011 02:09:26 +0200, Rolf Nielsen 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. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...