1834391 Members
1539 Online
110066 Solutions
New Discussion

ps

 
SOLVED
Go to solution
derek b smith_1
Regular Advisor

ps

I am running UNIX95= ps -ex
-o 'pid,pcpu,state,comm,time' and my output shows:

a process as such for the time column:

13619 3.53 S lm_ip 2-12:58:01

1889 1.53 R midaemon 1-04:51:25

my goal is to get the total elapsed time or total run time of a process since boot or since its inception.

tried using Perls Proc::ProcessTable but I do not have certain prereqs. :(

what is the 2- and 1- and why?

thanks
derek
5 REPLIES 5
Rodney Hills
Honored Contributor

Re: ps

I think that is number of days.

HTH

-- Rod Hills
There be dragons...
A. Clay Stephenson
Acclaimed Contributor

Re: ps

The values preceding the "-" are days.
If it ain't broke, I can fix that.
Cem Tugrul
Esteemed Contributor

Re: ps

Derek,

it refers days...

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't
Muthukumar_5
Honored Contributor
Solution

Re: ps

To find elapsed time use etime with -o option.

# UNIX95= ps -ex -o 'pid,pcpu,state,comm,time,etime'

hth.
Easy to suggest when don't know about the problem!
Arunvijai_4
Honored Contributor

Re: ps

etime - Elapsed time of the process. The default heading for this column is ELAPSED.

# UNIX95= ps -ex -o 'pid,pcpu,state,comm,time,etime'
PID %CPU S COMMAND TIME ELAPSED
0 0.02 S swapper 00:25 7-19:04:13
1 0.04 R init 00:08 7-19:04:56
8 0.00 R ioconfigd 00:00 7-19:04:56
9 0.02 S nfsktcpd 00:08 7-19:04:56
"A ship in the harbor is safe, but that is not what ships are built for"