From owner-freebsd-questions@FreeBSD.ORG Tue Jan 20 11:02:40 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 04EFD16A4F7 for ; Tue, 20 Jan 2004 11:02:40 -0800 (PST) Received: from priv-edtnes51.telusplanet.net (defout.telus.net [199.185.220.240]) by mx1.FreeBSD.org (Postfix) with ESMTP id 98D7043D68 for ; Tue, 20 Jan 2004 11:02:37 -0800 (PST) (envelope-from cpressey@catseye.mine.nu) Received: from catseye.biscuit.boo ([207.81.17.215]) by priv-edtnes51.telusplanet.netSMTP <20040120190237.IIBC16417.priv-edtnes51.telusplanet.net@catseye.biscuit.boo>; Tue, 20 Jan 2004 12:02:37 -0700 Date: Tue, 20 Jan 2004 11:06:44 -0800 From: Chris Pressey To: Ion-Mihai Tetcu Message-Id: <20040120110644.688e77bb.cpressey@catseye.mine.nu> In-Reply-To: <20040120205621.05fc84da@it.buh.cameradicommercio.ro> References: <20040120205621.05fc84da@it.buh.cameradicommercio.ro> Organization: Cat's Eye Technologies X-Mailer: Sylpheed version 0.9.8a (GTK+ 1.2.10; i386-portbld-freebsd4.9) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: grepping distinct lines from many text files ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 19:02:40 -0000 On Tue, 20 Jan 2004 20:56:21 +0200 Ion-Mihai Tetcu wrote: > Hi, > > > I know I have done this before, but I don't remember how ;) > > I have a collection of text files in one directory, and each file can > contain one or more lines of text, of which any of them could also be in > another file and what I want is to do something like: > > CUCU=`cat /path/do/dir/* | some_filer_program` > > and have in $CUCU the distinct lines from all the files. > > Something like SQL's SELECT DISTINCT FROM .... > > Any pointers ? man 1 uniq ? -Chris