[PLUG] more about specialized reports

Rogan Creswick creswick at cs.orst.edu
Tue Feb 4 23:44:01 UTC 2003


I think hte post above is a cleaner solution, but the code below can
be condensed:

grep gba /var/log/httpd/access_log | grep _small.jpg | wc

The first # output by wc is the line count (the number of lines that
matched both greps)

pipeing grep to grep is an invaluable tool for searching code, btw. 

find . -name "*.lisp" | xargs grep -in <function_name> 

if that floods your screen,

!! | grep -i "def"

and you have the file, line # and function prototype..

-Rogan


On Tue, Feb 04, 2003 at 11:26:04PM -0800, Mike De La Mater wrote:
> If I use this, I get the actual lines, but I only care about the counts. Should I 
> just egrep -c the result files?
> 
> Mike De La Mater
> Small business networks and technology consulting
> 503-702-6749
> mikedela at ipns.com 
> 
> 
> #!/bin/sh
> 
> MATCH="gba"
> LOGFILE="/var/log/httpd/access_log"
> 
> grep $MATCH $LOGFILE > /root/Desktop/gba.txt
> 
> 
> MATCH="small\|132\"
> LOGFILE="/root/Desktop/gba.txt"
> 
> grep -v $MATCH $LOGFILE > /root/Desktop/gba-1.txt
> 
> 
> 
> 
> 
> 
> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug




More information about the PLUG mailing list