Best unofficial Apache Server developers community
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account

Grepping through .gz log files

0

29 views

Does there exist a magical shell piping which would allow easily to grep through bunch of .gz log files without needing to extract them somewhere?

.gz files are Apache logs, result of log rotation. I'd like to quickly check how often certain URIs are accessed in the past.

asked May 11, 2011 7:10 am CDT
posted via ServerFault

3 Answers

3
 

The zgrep program is available for Linux (and perhaps some Unix too). This will decompress the files and then grep through them.

answered May 11, 2011 7:24 am CDT
2
 

How about zgrep? Seems to be installed on Mac OS and Ubuntu 11.04.

answered May 11, 2011 7:24 am CDT
2
 

You can just use zgrep to grep through compressed files.

If you need to use a specific grep, you can set the GREP environment variable:

export GREP=/bin/egrep

answered May 11, 2011 7:24 am CDT

Your answer

Join with account you already have


Sign in with Twitter account
Sign in with Facebook account
Sign in with Google Friend Connect

Preview
Similar questions
View .apk files
January 7, 2011
Upload big files?
April 6, 2011
FTP Ignoring Git Files
February 24, 2011
Postgresql log files
January 16, 2011
Php including files
January 2, 2011
Uploading files
April 13, 2011
Generating swf files
March 16, 2011
Two db connect files
February 21, 2011