From owner-freebsd-questions Fri Mar 12 7:46:48 1999 Delivered-To: freebsd-questions@freebsd.org Received: from torrent.hydro.on.ca (beck.Hydro.ON.CA [192.75.134.5]) by hub.freebsd.org (Postfix) with SMTP id A7C09155A4 for ; Fri, 12 Mar 1999 07:46:46 -0800 (PST) (envelope-from Jim.Service@oht.hydro.on.ca) Received: id KAA03325; Fri, 12 Mar 1999 10:46:34 -0500 Received: by gateway id KAA22669; Fri, 12 Mar 1999 10:41:14 -0500 (EST) Received: by gateway id KAA27849; Fri, 12 Mar 1999 10:41:13 -0500 Received: by gateway id ; Fri, 12 Mar 1999 10:42:05 -0500 Message-ID: From: SERVICE Jim -TS+NP DVLPMT To: "'Graeme Tait'" Cc: questions@FreeBSD.ORG Subject: RE: Use of pipe with gzip | more Date: Fri, 12 Mar 1999 10:41:50 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.1960.3) Content-Type: text/plain Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Why not use grep? % gzip -cd file.gz | grep 'your text string' More has to make a temporary file the same size as the unzipped file whereas grep just scans a sliding window "buffer" of the unzipped file. --Jim OHT Inc. mailto:jim.service@oht.hydro.on.ca > I was examining a large gzipped text file (about 6MB zipped) using > > $ gzip -cd file.gz | more > > and used "/[text]" to attempt to find a line that didn't > exist. As indicated by > top, "more" consumed all available CPU for a very long time, > its PRI value > rising to over 100 before it finally reported "Pattern not > found". The elapsed > time was a couple of orders of magnitude more than if I had > unzipped the file > first, and then run "more" on the unzipped file. However, > some files I do this > on are so large that unzipping first places a burden on > available file space. > > Is this a legitimate use of a pipe? > The pipe is fine. More is the problem. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message