Saturday, June 2, 2012

Finding Start time of a Linux Process

In Linux, finding Starting time of a process using 'top' output will always tend to confuse us. Below is a sample 'top' output of a bunch of 'cpio' process which are running on a Server. The TIME+ column shows some time but it is quite confusing to interpret.

Following are the command-set that I use to find actual Start-time of a Process and how long it runs:

[root@linuxhost ~]# ps -eo pid,lstart,cmd | grep -v grep | grep 14115
14115 Sat Jun  2 01:15:38 2012 cpio -pdmu /NA_cdb01_ud4001
[root@iss-365-tdb02 ~]# date
Sat Jun  2 02:01:41 PDT 2012
[root@linuxhost ~]# ps -eo pid,etime,cmd | grep -v grep | grep 14115
14115       46:23 cpio -pdmu /NA_cdb01_ud4001
[root@iss-365-tdb02 ~]#

The above output shows the Process with PID 14115 started at 01:15:38 AM PDT and it is running for more than 45 minutes.

No comments:

Post a Comment