Rank processes by CPU with memory, age, and full command
Build a paste-ready command, then review its compatibility and effects before running it.
ps -eo pid,ppid,user,%cpu,%mem,rss,etime,stat,command --sort=-%cpu | head -<count>Complete required fields to copy the generated command.
read-onlyno known side effects Compatibility
LinuxVerified for Linux using bash, zsh syntax.
Operational knowledgereview due 2027-01-19
Requirementspsps must be installed and available on PATH.
Version supportps Current supported releasesVerified for linux using bash, zsh syntax; consult compatibility notes for platform-specific differences.
Expected signalsPID PPID USER %CPU %MEM RSS ELAPSED STAT COMMANDRepresentative successful output; values vary with the selected target and system state.
Known errorsps: command not foundps is missing or is not available on PATH.
Verifyps -eo pid,ppid,user,%cpu,%mem,rss,etime,stat,command --sort=-%cpu | head -{{count}}The output matches the expected target and exits without an error.Rollback noteNot required: this command is read-only and does not change system state.
Command breakdown
01psCommandRuns the ps stage of this one-liner.
02-eoOptionConfigures ps with the -eo option.
03pid,ppid,user,%cpu,%mem,rss,etime,stat,commandArgumentPasses pid,ppid,user,%cpu,%mem,rss,etime,stat,command to ps.
04--sort=-%cpuOptionOrders results using the supplied field or expression.
05|PipelinePasses the output on the left to the command on the right.
06headCommandRuns the head stage of this one-liner.
07-<count>OptionConfigures head with the -<count> option.
This advanced community-curated one-liner combines several stages. Review every option and placeholder before running it.
Example input
ps -eo pid,ppid,user,%cpu,%mem,rss,etime,stat,command --sort=-%cpu | head -10
Example output
PID PPID USER %CPU %MEM RSS ELAPSED STAT COMMAND
8421 8120 app 92.4 14.1 1184200 01:22:17 Rl node server.js
991 1 root 18.7 1.2 101884 12-04:31 Ssl nginx: worker process
Illustrative output — exact values vary by system and data.
Official sources