Lets say you are on a system where top is not available (or other tools similar to it). Sound incomprehensible but believe me. There are systems which do not have any of those great tools available. So how do you find the process eating up most CPU? The humble ps
command provides pcpu
which is CPU percentage used by a process. Here is how.
ps -eo pcpu,pid,ruser,args | sort -r -k1 | less
This will give in reverse sort order the “pid” that is taking up most of pcpu
and the ruser
(real user) with args
. So there you have it.