Et un truc du genre ne te satisferait pas :
A tester et modifier à souhait :
ps -e -o s | awk 'BEGIN {
S=0
Z=0
O=0
R=0
T=0}
/T/ {T=T+1}
/S/ {S=S+1}
/Z/ {Z=Z+1}
/O/ {O=0+1}
/R/ {R=R+1}
END {print "T=" T " S=" S " Z=" Z " O="O " R=" R " Total="T+S+Z+O+R}
'
voila a sortie sur mon système :
T=0 S=133 Z=0 O=0 R=3 Total=136
Extraite de la doc de ps pour les états :
S (l) The state of the process:
O Process is running on a processor.
S Sleeping: process is waiting for an event to
complete.
R Runnable: process is on run queue.
Z Zombie state: process terminated and parent not
waiting.
T Process is stopped, either by a job control sig-
nal or because it is being traced.
Cordialement
Pascal Garcia
Le vendredi 17 février 2006 à 14:37 +0100, Tzacos a écrit :
> Salut,
>
> en dehors de top (qui n'est pas efficace coté performance pour etre
> inclu dans un script), avec quoi peut on obtenir le nombre de processus
> totaux, actifs,dormants,arretes et zombie?
>
> je n'arrive pas a trouver une commande en shell qui puisse me le faire
>
> laurent
>
> ---------------------------------------------------------------------------------------
> Wanadoo vous informe que cet e-mail a ete controle par l'anti-virus mail.
> Aucun virus connu a ce jour par nos services n'a ete detecte.
>
> pièce jointe Document plein texte (message-footer.txt)
> ____________________________________________________
> Want to buy your Pack or Services from Mandriva?
> Go to http://store.mandriva.com
> Join the Club : http://www.mandrivaclub.com
> ____________________________________________________
____________________________________________________
Want to buy your Pack or Services from Mandriva?
Go to http://store.mandriva.com
Join the Club : http://www.mandrivaclub.com
____________________________________________________