ps command (Linux / bash / sh / zsh)
What it does
Display a snapshot of running processes. When people search for the ps command linux processes, they usually want ps's everyday flags, safe examples, and how it differs from related tools. Below you'll find syntax, options, and copyable examples for Bash/sh/zsh.
Display a snapshot of running processes.
Syntax
ps [OPTION]...
Common options
| Flag / option | Meaning |
|---|---|
| aux | Show all users' processes in BSD format. |
| -ef | Show every process in full-format POSIX style. |
| -p PID | Select a process by ID. |
| --sort=KEY | Sort by a process field. |
Practical examples
All processes
ps aux
Shows a detailed system-wide process snapshot.
One process
ps -p 4242 -o pid,ppid,cmd,%mem
Selects useful fields for PID 4242.
Top memory users
ps aux --sort=-%mem
Sorts processes by descending memory use.
Linux ↔ Windows equivalent
Closest match: Get-Process (Windows / PowerShell). Retrieve local or remote process objects and resource metrics.
Common mistakes
- Mixing BSD and POSIX option styles without understanding changed output columns.
- Expecting ps to refresh continuously; use top for live updates.
Related commands
- topMonitor processes and system resource use in real time.
- killSend a signal to one or more processes.
- Get-ProcessRetrieve local or remote process objects and resource metrics.
- tasklistList local or remote running processes with selectable fields and filters.
- Stop-ProcessStop one or more local processes by name, ID, or pipeline input.
- taskkillEnd processes by process ID or executable image name.
FAQ
What does ps do in Linux?
Display a snapshot of running processes.
How do I use ps from the terminal?
Start with `ps [OPTION]...`, then choose only the options needed for the task.
What is a practical ps example?
Try `ps aux` — Shows a detailed system-wide process snapshot.
Can I use ps in a shell script?
Yes. ps works in Bash, sh, and Zsh, but scripts should handle quoting, errors, and command output explicitly.
Browse the full Linux and Windows command reference to search more bash, CMD, PowerShell, Conda, and GitHub CLI commands.