Calculate the amount of time in the linux process using perl script

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2004
Posts: 4
Reputation: flory is an unknown quantity at this point 
Solved Threads: 0
flory flory is offline Offline
Newbie Poster

Calculate the amount of time in the linux process using perl script

 
0
  #1
Oct 3rd, 2004
Hello all!

Can somebody help me write a perl script which totals the total amount of time that each user is using on the system, as well as the number of processes the user is using.

As example:
The output of your program would be the following:

root 00:01:18 13
ananias 00:00:00 1
dias 00:00:00 1
peter 00:00:00 1
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,740
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 739
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Calculate the amount of time in the linux process using perl script

 
0
  #2
Oct 3rd, 2004
>Can somebody help me write a perl script which totals the total amount of time that each user is using on the
>system, as well as the number of processes the user is using.
Pipe the result of a call to ps through your script and parse it, saving the items you want and calculating your totals. ps is different for every system, so do a man ps and when you have more information and you've actually made an attempt, come back and we can help more.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC