From owner-freebsd-questions Mon Jun 19 17:59: 5 2000 Delivered-To: freebsd-questions@freebsd.org Received: from ns1.davidv.net (ns1.davidv.net [205.241.169.123]) by hub.freebsd.org (Postfix) with ESMTP id 8954537B76C for ; Mon, 19 Jun 2000 17:59:01 -0700 (PDT) (envelope-from david@davidv.net) Received: from devnull (devnull [205.241.169.122]) by ns1.davidv.net (8.9.3/8.9.3) with SMTP id UAA07480 for ; Mon, 19 Jun 2000 20:00:30 -0500 (CDT) (envelope-from david@davidv.net) Message-Id: <200006200100.UAA07480@ns1.davidv.net> X-Sender: david@mail.davidv.net X-Mailer: QUALCOMM Windows Eudora Pro Version 4.0 Date: Mon, 19 Jun 2000 19:58:48 -0500 To: questions@FreeBSD.ORG From: David Vondrasek Subject: grep / zgrep help In-Reply-To: <00062110360903.00320@desktop.freebsd.org> References: <200006191448.SM00167@pop.sby.globalinfo.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Im trying to create a search tool to locate text on a CD. The directory tree is very *deep* I know the basic zgep expression to grep one file or " * " for all files, even add a -r to get the full tree.. But geezzz this takes almost an hour for the full tree when All I need is one file in each directory to be searched.. Can any one help with a expression line here ? Here is what I have now and the output goes to a webpage. $4 = the string you are looking for input from the form on the webpage /usr/bin/zgrep "$4" /cdrom/mail/radius/jan2000/31_1205/ghtdfw/billing.gz A normal tree looks as such root@abuse5:/cdrom/mail/radius/jan2000 : ls -la total 137 dr-xr-xr-x 64 root wheel 8192 Feb 9 08:05 . dr-xr-xr-x 3 root wheel 2048 Feb 9 03:37 .. dr-xr-xr-x 10 root wheel 2048 Dec 31 18:08 01_0005 dr-xr-xr-x 10 root wheel 2048 Jan 1 06:07 01_1205 dr-xr-xr-x 10 root wheel 2048 Jan 1 18:09 02_0005 dr-xr-xr-x 10 root wheel 2048 Jan 2 06:07 02_1205 2 directories for each date with 12 hours woth of logs in each directory. deeper still is : root@abuse5:/cdrom/mail/radius/jan2000/01_0005 : ls -la total 46 dr-xr-xr-x 10 root wheel 2048 Dec 31 18:08 . dr-xr-xr-x 64 root wheel 8192 Feb 9 08:05 .. dr-xr-xr-x 2 root wheel 2048 Dec 31 18:04 cor dr-xr-xr-x 2 root wheel 2048 Dec 31 18:04 den dr-xr-xr-x 2 root wheel 22528 Feb 9 08:06 detail etc .... and deeper the last directory root@abuse5:/cdrom/mail/radius/jan2000/01_0005/den : ls -la total 40 dr-xr-xr-x 2 root wheel 2048 Dec 31 18:04 . dr-xr-xr-x 10 root wheel 2048 Dec 31 18:08 .. -r--r--r-- 1 root wheel 326 Feb 9 11:30 TRANS.TBL -r--r--r-- 1 root wheel 1332 Dec 31 18:05 active.gz -r--r--r-- 1 root wheel 35072 Dec 31 18:05 billing.gz -r--r--r-- 1 root wheel 25 Dec 31 18:05 dead.gz -r--r--r-- 1 root wheel 26 Dec 31 18:05 deads.gz -r--r--r-- 1 root wheel 44 Dec 31 18:05 marks.gz -r--r--r-- 1 root wheel 46 Dec 31 18:05 reasons.gz -r--r--r-- 1 root wheel 1402 Dec 31 18:05 usage.gz The ONLY file that needs to be look at in each tree is the " billing.gz " file. I need to be able to issue a command in /cdrom/mail/radius/ and have it JUST searcjh though the billing.gz files in each subtree below. This should cut my search time to about 1/20 of the time it does now with /usr/bin/zgrep "$4" /cdrom/mail/radius/jan2000/ * help from any of you script gods ? and please don't say " man zgrep " I've read it and tried everything I know from it. Thanks David Vondrasek http://www.davidv.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message