ps -axo %cpu | perl -ne 'next if ($. == 1); $sum += $_; END { print "$sum%\n" }'
Comment on
%CPU use (under linux)
Replies are listed 'Best First'.
Re: %CPU use (under linux)
by
merlyn
(Sage)
on Mar 28, 2001 at 23:45 UTC
For a cute little curses gadget that watches CPU time without forking
ps
, you can adapt
my webserver watching program
from one of my first Linux Magazine columns.
--
Randal L. Schwartz, Perl hacker
[reply]
Back to
Cool Uses for Perl