[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: commande ps pour un script



Salut,

On 05/07 13:57, bernard.schoenacker@free.fr wrote :
> pour un script je recherche à tuer le processus le plus gourmand en
> mémoire pou en temps CPU ...

ps ax -o time=,pid= | sort -nr | head -n 1 | awk '{print $2}'

Cela te donne le pid du process qui a consommé le plus de temps
processeur.

kill -9 `ps ax -o time=,pid= | sort -nr | head -n 1 | awk '{print $2}'`
... le tue

a+

jms



Reply to: