Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save laszlomiklosik/4b561832a5183c2be15b to your computer and use it in GitHub Desktop.
Save laszlomiklosik/4b561832a5183c2be15b to your computer and use it in GitHub Desktop.
Linux see how long a process has been running - uptime
# Example command for checking how long a Java process was running (etime = elapsed time)
ps -eo pid,comm,cmd,start,etime | grep java
# It will return something like:
# 21443 java /opt/jdk8/bin/java -Djava.u Feb 25 3-12:46:12
# and this means an uptime of 3 Days, 12 Hours, 46 Minutes and 12 Seconds
# More alternatives & explanations here: http://linuxcommando.blogspot.ro/2008/09/how-to-get-process-start-date-and-time.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment