18 Jan
2013
18 Jan
'13
12:34 p.m.
I want to display the first few line of each of a batch of log files, some of which are gzipped. Normally I'd use zcat in place of cat, zgrep in place of grep, etc, to work with a mixture of compressed and uncompressed files. But zhead and ztail don't exist. What's the best way to achieve this: zhead -n1 /var/log/syslog* (show the first line of each syslog* file)? All the thoughts I had got increasingly convoluted. Obviously stuff like: zcat /var/log/syslog* | head -n1 .. doesn't achieve what I want... -- Mark Rogers // More Solutions Ltd (Peterborough Office) // 0844 251 1450 Registered in England (0456 0902) 21 Drakes Mews, Milton Keynes, MK8 0ER