Command to check the CPU usage for particular user

Hi All,

Can anybody knows, how to check the CPU usage in percentage for a particular process along with its user and PID?

Thanks in advance!!

Command top lets you know of the useful information such as total memory, memory in use, % of total memory used by each process, % cpu usage of each process, and process ID (PID) of each process. Some of the options to it

top -u <user_name>
top -p <pid>

Have a look at the man page of "ps", especially the "-o" option and its various arguments. For instance, the following will show the CPU%, the PID and the CMD columns of each process, sorted by CPU consumption:

ps -Alo pcpu,pid,args | sort -rn

You might probably want to modify the command according to your needs and what you find in the man page.

I hope this helps.

bakunin

Thanks for the reply guys!