concatenate compressed and uncompressed logs

concatenate compressed and uncompressed logs

$ find /var/log/apache2 -name \'access.log*gz\' -exec zcat {} ; -or -name \'access.log*\' -exec cat {} ; This command allows you to stream your log files, including gziped files, into one stream which can be piped to awk or some other command for analysis.

Note: if your version of \’find\’ supports it, use:

find /var/log/apache2 -name \'access.log*gz\' -exec zcat {} + -or -name \'access.log*\' -exec cat {} +

by David Winterbottom (codeinthehole.com)


URL: http://feedproxy.google.com/~r/Command-line-fu/~3/iwFUyltYgjM/concatenate-compressed-and-uncompressed-logs

\"Enhanced

About Amit Agarwal