Re: Count lines in file..fast

From: Gosselin, Mark (gosselinm@NETSCOUT.COM)
Date: Thu Jun 19 2003 - 07:41:11 EDT


or

grep mystring myfile | wc -l

        -----Original Message-----
        From: Jean-Marc Monnez [mailto:monnez.jean-marc@AGORA.MSA.FR]
        Sent: Thu 6/19/2003 6:50 AM
        To: aix-l@Princeton.EDU
        Cc:
        Subject: Re: Count lines in file..fast

        grep -c mystring myfile
        (or fgrep)

        -- JMM

        -----------------------------
        Jean-Marc MONNEZ
        MSA / AGORA / ATD
        monnez.jean-marc@agora.msa.fr
        -----------------------------

        Arthur Prince wrote :

> I need a fast method of counting lines in a file that contain a specific
> string.
>
> I am currently using grep mystring myfile | wc -l
>
> but this is slow on large files.
>
> Anyone got a faster method?
>
> AP



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:55 EDT