0

How do I find username that in total (i.e sum for all processes) uses the most CPU time?

Also I want to find the total amount of memory consumed by running processes of that user and output processes of that user which use > 50 percent of CPU time.

I don't really know how to parse ps in order to be able to maintain the sum for each user.

  • If you're on Linux w/ systemd, and have DefaultCPUAccounting=yes in /etc/systemd/system.conf, then systemd-cgtop should do it. Quite a lot of assumptions, so not really an answer... – derobert Jun 4 '17 at 0:19
0

If you're after realtime results, without the need to parse ps, use top.

top

then press

u

type in the username of the person you want to search, then press enter.

Pressing > will sort based on a specific column, (in this case you want to keep pressing > until you are sorting by %CPU) TIME+ is actual CPU time, not the duration the process has been running. (A common misconception).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.