1)looping accross all the files in the directory and printing filename and uniq epoch timestamps into a file.
for file in `ls -tr` ; do echo $file >> /tmp/epochs; perl -nlaF"^B" -e 'if ($F[0] eq "z") { my @t= eval "$F[4]-($F[4] % 86400)" ; print @t; } ' $file |
sort -u >> /tmp/epochs ; done
or
for file in `ls -tr` ; do echo $file >> /tmp/epoch.two; perl -nlaF"^B" -e 'if ($F[0] eq "z") { my $t= eval "$F[4]-($F[4] % 86400)" ; print $t; } ' $file
| sort -u >> /tmp/epoch.two ; done
2)taking only the epochs from that file and converting them to readable format.
perl -wnl -e ' if ( length() == 10 ) { print $_;} ' /tmp/epochs | while read line ; do date --date "1970-01-01 UTC $line seconds" ; done
No comments:
Post a Comment