ps Cheatsheet - Linux Process Management Reference
Can't see a process, wondering who ate the memory, need a PID — ps is the first step for all of these. Knowing the difference between BSD-style aux and System-V-style -ef, then pairing grep, --sort, and -o custom columns, lets you filter precisely from the noise.
Basic View 6
psProcesses in the current terminal
ps auxAll processes (BSD style)
ps -efAll processes (System V style)
ps -eAll processes
ps -fFull-format output
ps -lLong-format output
Filter 7
ps -p 1234Process by PID
ps -p 1234,5678Multiple PIDs
ps -u usernameProcesses of a user (effective)
ps -U usernameProcesses of a real user
ps -g groupnameProcesses of a group
ps -C nginxProcesses by command name
ps --ppid 1234Child processes of a parent PID
Custom Format 7
ps -eo pid,comm,userSelect output columns
ps -eo pid,ppid,comm,%cpu,%memPID, parent, command, CPU and memory
ps -eo pid,comm,etimeProcess elapsed time
ps -eo pid,comm,statProcess state
ps aux --sort=-%cpuSort by CPU usage, descending
ps aux --sort=%memSort by memory usage, ascending
ps aux --sort=-rssSort by resident memory, descending
Process Tree 5
ps -ejHShow process tree (System V style)
ps axjfShow process tree (BSD style)
pstreeShow process tree (needs psmisc)
pstree -pProcess tree with PIDs
pstree -uProcess tree with users
Threads 4
ps -eLfShow all threads
ps -p 1234 -LThreads of a given process
ps -eTShow thread IDs
ps -H -p 1234Thread hierarchy of a process
Common Patterns 6
ps aux | grep nginxFind nginx processes
ps aux --sort=-%cpu | headTop CPU consumers
ps aux --sort=-%mem | headTop memory consumers
ps -ef | grep defunctFind zombie processes
ps -eo pid,comm,etime | grep -v defunctNon-zombie processes with elapsed time
ps -u username -o pid,comm,%cpu,%memA user's process resource usage
Tips
- Both ps aux and ps -ef list all processes; aux is BSD style, -ef is System V style.
- ps is a snapshot; top/htop show live data.
- Zombie state is Z; you can't kill it — kill its parent or reboot.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us