Skip to content

Instantly share code, notes, and snippets.

@notsobad
Created November 29, 2013 07:32
Show Gist options
  • Save notsobad/7702596 to your computer and use it in GitHub Desktop.
Save notsobad/7702596 to your computer and use it in GitHub Desktop.
Get the age the of pid.
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