Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google site




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 08-02-2007
swamy455 swamy455 is offline
Registered User
 

Join Date: Jul 2005
Posts: 5
Line count for compressed files

Hi All,
I have requirement to count the number of records in a zipped file (*.gz) without decompressing it. I am using the following (I am unzipping to stdout and counting)

gzcat <filename>.gz |wc -l (same as gunzip -c)

I am trying to see if there is a faster and less resource consuming approach as I would be doing this on a huge set of files every day. Your help is highly appreciated.
Thanks.
-S
Sponsored Links