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 -10In 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
top Command Reference: Flags, Batch Mode & CI ExamplesReference for top: -b batch mode, -n, -o, -d, the non-interactive logging pattern, and a CI example that capt…
lsof Command Reference: Flags, Usage & CI ExamplesReference for lsof: -i, -P, -n, -p, -t, the port-and-file-owner use, and a CI example that finds which proces…
free Command Reference: Flags, Usage & CI ExamplesReference for free: -h, -m, -s, the available-vs-free distinction, and a CI example that checks memory headro…