Skip to main content

Command referenceps

ps command (Linux / bash / sh / zsh)

Linuxbashshzshprocessbeginner

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 / optionMeaning
auxShow all users' processes in BSD format.
-efShow every process in full-format POSIX style.
-p PIDSelect a process by ID.
--sort=KEYSort 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.

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.