I know the top command to see the process of CPU and memory usage, but some users of the system can generate a lot of processes, if I wanna know total CPU and memory usage of an user,I must count it by my own,so,is there a command which can view total CPU and memory usage of per system user in Linux,and order by system username?
Linux – How to view total CPU and memory usage of per system user in Linux
cpucpu usagelinuxmemoryuser
Best Answer
I don't think there's a direct way of doing it - but one way would be to parse the output of top. The following
does just that. For each process in top (for a given user) awk will strip the 9th delimited field (i.e. CPU %) 7 lines down (i.e. start of the top table) for each line, then sum them. Saves you fiddling about at least!
A couple of discussions around this...
Howtoforge, Stackexchange