...
Use zgrep "DATE=" <log> | head -n 1
to find the start date. Use zgrep "DATE=" <log> | tail -n 1
to find the end date. If you would like you can write a bash
function to make this easier:
Code Block |
---|
get_dates()
{
for f in atm.log.*.gz; do
echo $f
zgrep "DATE=" $f | head -n 1
zgrep "DATE=" $f | tail -n 1
echo ""
done
} |
(If zgrep
is unavailable, use less <log>
to look at a gzipped log file. Scroll down a decent amount to DATE=
to find the start date. Use SHIFT+g
to go to the end of the file. Scroll up to DATE=
to find the end date.)
...