← System & Processes
Linux · System & Processes
How to find the top CPU and memory consuming processes in Linux
Find the processes using the most CPU or memory with ps --sort and top, so you can spot what is loading a Linux server.
Find the heaviest processes by CPU or memory. ps --sort gives a quick static top-N; top shows it live.
# Top 10 by CPU
ps -eo pid,user,%cpu,%mem,cmd --sort=-%cpu | head -n 11
# Top 10 by memory
ps -eo pid,user,%cpu,%mem,cmd --sort=-%mem | head -n 11
# Live view (press P = sort by CPU, M = by memory, q = quit)
top
# One-shot snapshot from top (non-interactive)
top -b -n 1 | head -n 20LinuxtopProcesses