I'm looking for a way to log the pid of process higher than a fixed value of cpu (ex 40%).
I tried with command like this :
ps -eo pcpu,pid,user,args | sort -k 1,2 -r | head -10
But, first, it sorts by the first column of the output, not by the first value ... (1,20,2,3,31,4 ...), and strangly, the ps
command doesn't show me the process higher than 20%! (I know there is some, by top
).
Tks