Sunday, September 1, 2013

Unix Timestamp conversion (Convert Unix Time)

Have you ever had the chance to work on logs to investigate on a few items that needs immediate reports and judgement, while you are at it logs shows the standard "unix" convention.  To spare you all this hardship use the following formatting on every known log you have.

perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'

I does all the magic for you.

e.g.  tail -n 20000 /some_path_to_logs | (command above) | less


No comments:

Post a Comment