Re: Need to find top process and identify the PID. (703 Views)
Reply
Advisor
Alok_Behria
Posts: 28
Registered: ‎09-14-2011
Message 1 of 4 (731 Views)

Need to find top process and identify the PID.

 

Hi All,

 

OS :- ptmsap> uname -a
HP-UX tbx4 B.11.11 U 9000/800 3251073457

 

I need to find out the top process consuming CPU and memory. I am using following command to find the top consuming process, but it's failing for some reason. I am using this command referred in one of the oracle book.

also, I would also appriciate , if you could describe each parameter passing to whole command.

 

ps -e pcpu,pid,user,tty,args | sort -n -k 1 -r | head

 

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 2 of 4 (724 Views)

Re: Need to find top process and identify the PID.

>I am using following command to find the top consuming process, but it's failing for some reason. I am using this command referred in one of the oracle book.

 

This isn't valid for HP-UX, or there are a few things missing:

UNIX95=EXTENDED_PS ps -e -opcpu,pid,user,tty,args | sort -n -r -k1,1 | head

 

UNIX95= enables -o;  -e every PID; -o only those fields

sort: -n numeric, -r reverse, -k key 1

Advisor
Alok_Behria
Posts: 28
Registered: ‎09-14-2011
Message 3 of 4 (708 Views)

Re: Need to find top process and identify the PID.

 

Dannies, thank for offering your inputs on this. I was thinking of if that command is not suitable for HPUX , how could I able to see top process on machine consuming the highest cpu cycles ? would also appreciate, along with the command , you describe each and every flag. Thanks once again for your inputs.

Acclaimed Contributor
Dennis Handly
Posts: 25,277
Registered: ‎03-06-2006
Message 4 of 4 (703 Views)

Re: Need to find top process and identify the PID.

> thinking of if that command is not suitable for HP-UX

 

My corrected version works in a real shell.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.