Re: [ssfr] script sur la commande top |
[ Thread Index |
Date Index
| More debianworld.org/shellscript-fr Archives
]
- To: shellscript-fr@xxxxxxxxxxxxxxx
- Subject: Re: [ssfr] script sur la commande top
- From: JJL <buggerone@xxxxxxxxx>
- Date: Thu, 11 Feb 2010 14:44:30 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZbqMXBKinYJPVfLtNCdKp57cWvCUUvHTA9q5mVrHmaw=; b=NJj8T2wR1leduuXbgF+MesC0XfT+tfSVicxM/QHkdfeFfwhz2Eib7PICkO0KmIMLHq wZ5nvXwCtUrRAL3lUOJTHMcHpt2gQA6t599aZmobjW4Epjep58RLPk72Ns96tk6Nc5b2 EeziJN365pF2kd/X2j/+KpWJGAcuABkNZMJNU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=mLSKyKEPSscJAKB9cZAxYkmpBwldfQr54DBVhp0EM0yjCqVixs1Xi21hTMcPFFjp+R RKsB9/CyIF+VnMBhKQ8cRRU0G39dHn9ty5Jpwm/C5tM4N69R0NqZ6aP8qpaJGl8uM5iX 983ZMf4G2yhSH4+98pal6RyQb7Yc3ebv65hvQ=
Hello,
> pour ceux qui prennent du % CPU
>
> bon j'ai un peu avancé! attention les yeux! voilà le cpu des 9 process les
> plus gourmants...
> ps -eo pcpu | sort -k 1 -r | head -10 | tail -9
>
> je voudrais sommer ces valeurs ??? je fais comment ?
Calculs 'complexes' en bash --> bc http://www.gnu.org/software/bc/
disponible à peu prêt partout
ps -eo pcpu | sort -k 1 -r | head -10 | tail -9 | xargs | sed 's/ /+/g' | bc
++
JJL
--
http://kubuntu.free.fr/blog