Computing.Net > Forums > Unix > CPU for a pid in plain text? How do I ge

CPU for a pid in plain text? How do I ge

Reply to Message Icon

Original Message
Name: Geoff
Date: July 6, 2001 at 02:07:16 Pacific
Subject: CPU for a pid in plain text? How do I ge
Comment:

I'm trying to create a tool that will search for a certain pid and match it with a CPU% usage. How can I do this? top and glance are real screwy.


Report Offensive Message For Removal


Response Number 1
Name: Andy Hibbins
Date: July 6, 2001 at 12:22:25 Pacific
Subject: CPU for a pid in plain text? How do I ge
Reply: (edit)

Have you tried running "ps" with the following options:

ps -p "pid" -o pid,cpu,comm --noheader

whereis "pid" is the pid you require.
This will work in Linux.

output would be something like:


590 0.5 portmap


Andy Hibbins :)


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: CPU for a pid in plain text? How do I ge

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software