When to use ps
Use ps for a snapshot of running processes, useful in noninteractive sessions and troubleshooting reports. Select useful columns and sort deliberately rather than assuming the default view includes every task.
Syntax
ps [PARAMETERS]Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.
Common options and arguments
Usage examples
View all processes
ps -efA broad process list includes ownership, IDs and command details.
Show your user's processes
ps -u "$USER" -o pid,ppid,stat,etime,cmdThe current user's processes are shown with selected status and elapsed-time fields.
Sort by memory in procps
ps aux --sort=-%mem | head -n 10Processes are sorted by memory percentage and a short leading subset is displayed.
Notes and limitations
- ps provides a snapshot of process state, not continuous monitoring.
- procps supports several option styles. Check the documentation before mixing them.
Common questions and troubleshooting
Why does ps not continuously refresh?
It produces a snapshot. Use top or htop when you need a changing interactive view.
Can process command lines contain secrets?
Yes. Arguments can reveal tokens or passwords supplied by applications. Do not paste unreviewed process listings into public reports.
Further help
Options vary by version and distribution. Check the installed documentation with this command: man ps.