Operating System - HP-UX
1753474 Members
4806 Online
108794 Solutions
New Discussion юеВ

List process that are running more than X minutes

 
Singaram
Advisor

List process that are running more than X minutes

Hi all

How to identify the processes which are running for more than X minutes?.

ps -ef gives only the cpu time. i would like to go by actual time.

Thanks for your help.

Singaram
2 REPLIES 2
Jean-Louis Phelix
Honored Contributor

Re: List process that are running more than X minutes

Hi,

You can use etime or time fields in POSIX output of ps. Use :

UNIX95= ps -e -o pid,time,args

Regards.

PS : be careful to the space char after UNIX95= !!!
It works for me (┬й Bill McNAMARA ...)
Jeff Schussele
Honored Contributor

Re: List process that are running more than X minutes

Hi Singaram,

You'll have to use etime on that POSIX ps output as time is CPU time. etime is elapsed time of the process & will look like

19-19:31:08

Where the first numeric is days & the second is hours:minutes:seconds of current day.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!