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.

1
  • 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
    Commented Jun 4, 2017 at 0:19

1 Answer 1

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).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .