Linux Commands / IT Support Guides
Find Linux resource consumers with ps
List Linux processes by CPU usage and identify the program and account behind each entry.
Environment and inputs: Linux · Bash-compatible shell; package and service names vary by distribution
Understand the problem
Use the terminal on the affected host. A snapshot is a list of processes at the time you ran the command.
Run the command
Run the example to sort processes by CPU usage. The pipe sends the list to head, which keeps up to 15 lines including the header.
ps -eo pid,ppid,user,comm,%cpu,%mem --sort=-%cpu | head -n 15
Read the output
PID identifies the process and PPID identifies its parent. USER shows the account and COMMAND shows the program name. The %CPU value is averaged over the process lifetime, so a brief spike can be missed.
Choose the next step
Confirm that a high-ranked process belongs to the service you suspect. If you need to see short spikes, use top to watch several updates during the slowdown.
Before making changes
Record the time, PID and program name before acting. Check who owns the service and what stopping it would affect.