Finding Out What Processes are Running with ps

Code Listing 9.12. Using ps, you can find out what processes are currently running.
[jdoe@frazz jdoe]$ ps
 PID TTY      TIME CMD
21016 pts/22  00:00:00 bash
21707 pts/22  00:00:00 ps
[jdoe@frazz jdoe]$ ps -a PID TTY TIME CMD 21407 pts/3 00:00:00 su 21411 pts/3 00:00:00 bash 21441 pts/3 00:00:00 su 21444 pts/3 00:00:00 bash 19274 pts/11 00:00:05 xterm 23357 pts/12 00:00:04 xterm 13369 pts/5 00:00:00 zsh 23815 pts/9 00:00:00 su 23818 pts/9 00:00:00 bash 23878 pts/9 00:00:00 csh 23942 pts/9 00:00:01 ssh 23972 pts/18 00:00:00 su 23975 pts/18 00:00:00 bash 24103 pts/5 00:00:00 ssh 4658 pts/15 00:00:11 ssh 24318 pts/8 00:00:01 xterm 29188 pts/4 00:00:00 rxvt-2.7.9 29368 pts/4 00:00:00 rxvt 29440 pts/8 00:00:00 ...

Get Unix Third Edition: Visual Quickstart Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.