Skip to content
Latchkey

ps Command Reference: Flags, Usage & CI Examples

ps reports a snapshot of running processes.

ps shows currently running processes with their PIDs, owners, and resource use. In CI it is the snapshot tool for debugging hung steps, orphaned children, or memory pressure.

Common flags and usage

  • aux: all processes, BSD-style columns
  • -ef: all processes, full-format (System V style)
  • -o pid,ppid,rss,comm: choose output columns
  • --sort=-rss: sort by a field (here, memory)
  • -p <pid>: show a specific process
  • -C <name>: select by command name

Example

shell
ps -eo pid,ppid,rss,pcpu,comm --sort=-rss | head -10

In CI

A snapshot like the one above surfaces the top memory consumers when a job hits an OOM kill or runs slow. ps is a point-in-time view; use top for a live, continuously updating picture.

Key takeaways

  • ps gives a one-shot snapshot of running processes.
  • Custom -o columns plus --sort focus on CPU or memory hogs.
  • Use top when you need a live, refreshing view.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →