If you want to find out which applications you run eat the most of your CPU, run the command below:
ps -eo pcpu,pid,args | sort -k 1 -r | head -10
This will display a top 10 list of those processes, starting with the hungriest at the top.
If you want to find out which applications you run eat the most of your CPU, run the command below:
ps -eo pcpu,pid,args | sort -k 1 -r | head -10
This will display a top 10 list of those processes, starting with the hungriest at the top.
Or you can just run
top
Simpler than all that pipelining, don’t you think?
@Visionplanet: of course it’s simpler. But try using top’s output in a script…
# top -n 1 >> /tmp/top.log
but of coz the command are easier to store information into log file