Created
November 29, 2013 07:32
-
-
Save notsobad/7702596 to your computer and use it in GitHub Desktop.
Get the age the of pid.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pid_age(){ | |
pid=$1 | |
start=`stat -t /proc/$pid | awk '{print $14}'` | |
now=`date +%s` | |
count=`expr $now - $start` | |
echo $count | |
} | |
pid_age $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment