paulgorman.org/technical

Unix Shell Cookbook

Time Elapsed Since Last Log Entry

FreeBSD:

grep -i 'link state changed' /var/log/messages \
| tail -1 \
| awk '{ print "\"" $1 " " $2 " " $3 "\"" }' \
| xargs date -j -f "%b %e %H:%M:%S" +"%s"

OpenBSD