Unix Timestamps

One of the first things a PHP coder will bang into is Unix Timestamps and making them usable and readable. I’m currently trying to work with some very simple shell scripts in Unix and now I actually WANT raw timestamps, but noooo, can’t get them. Outrageous.

So, I’m working my way through the world of Unix resources and this post is pretty much to bookmark my list of useful sites – partly to help me find them later, and partly to acknowledge the help they have given.

As for the timestamps in the end we used this:

ps -e -o etime,pid,args|grep iwserver|grep -v grep|awk '{print $1,$2}'|grep "\-"|while read age pid

which looks at the process elapsed time and sees if it has a hyphen in it – and therefore must be over 24hours old. Not terribly scientific but it works!


Recent Comments


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.