I have all my Apache access log files as access.log, access.log.1 access.log.1.gz
etc... What I want is to zcat
all files in and not in gzip format and pipe them into an X program.
I know I can do: zcat /var/log/apache2/access.log.*.gz | someapp...
but that will just work for *.gz
and not the first two logs.
Any ideas will be appreciate it
While working with the archived files in Linux, we might face the error “gzip:stdin: not in gzip format”. This error occurs because the file has only been archived, not compressed. That means the file is not compressed using gzip utility rather renamed.
Description. The zcat command allows the user to expand and view a compressed file without uncompressing that file. The zcat command does not rename the expanded file or remove the . Z extension. The zcat command writes the expanded output to standard output.
On Unix-like operating systems, the gzip command creates, lists, modifies, and extracts data from GZIP archives. The gunzip command extracts data from GZIP archives.
use zcat -f, it will copy uncompressed files as is
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With