From owner-freebsd-questions@FreeBSD.ORG Sat May 7 03:10:47 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 666F1106566C for ; Sat, 7 May 2011 03:10:47 +0000 (UTC) (envelope-from prvs=010187b771=johnl@iecc.com) Received: from gal.iecc.com (gal.iecc.com [64.57.183.53]) by mx1.freebsd.org (Postfix) with ESMTP id 334F68FC08 for ; Sat, 7 May 2011 03:10:46 +0000 (UTC) Received: (qmail 15110 invoked from network); 7 May 2011 02:44:04 -0000 Received: from mail1.iecc.com (64.57.183.56) by mail1.iecc.com with QMQP; 7 May 2011 02:44:04 -0000 Date: 7 May 2011 02:43:42 -0000 Message-ID: <20110507024342.98559.qmail@joyce.lan> From: "John Levine" To: freebsd-questions@freebsd.org In-Reply-To: <4DC49CC3.8000103@lazlarlyricon.com> Organization: X-Headerized: yes Mime-Version: 1.0 Content-type: text/plain; charset=utf-8 Content-transfer-encoding: 7bit Cc: Subject: Re: Comparing two lists X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 May 2011 03:10:47 -0000 >Some 10,000 to 20,000 lines each. I do need only the common lines. Order >is not essential, but would make life easier. I've tried a little with >uniq, as suggested by Polyptron, but I guess 3am is not quite the right >time to do these things. Anyway, thanks. sort -u file1 > sorted-file1 sort -u file2 > sorted-file2 comm -12 sorted-file1 sorted-file2 > result R's, John