in reply to Using Perl to find Process Hogs
ps -eo pcpu,pid | sed '1d; s/^ *//; s/ */ /g;' | sort -nr
Update:
One assumption here is that process IDs don't get wrapped around in half an hour, but what are the chances of that?
Another update:
Thinking about it some more, since only one process can consume 75% of CPU at one time, you can append this piece to the pipeline above:
| head -1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using Perl to find Process Hogs
by Octavian (Monk) on Apr 17, 2003 at 18:50 UTC | |
by VSarkiss (Monsignor) on Apr 17, 2003 at 18:58 UTC | |
by perlplexer (Hermit) on Apr 17, 2003 at 18:55 UTC | |
by dmitri (Priest) on Apr 17, 2003 at 18:55 UTC |