Concept Flow - ps (list processes)
Run 'ps' command
System collects process info
Display process list
User reads output or pipes it
The 'ps' command asks the system to gather current process details and then shows them as a list.
ps
| Step | Action | System Response | Output Example |
|---|---|---|---|
| 1 | User types 'ps' and presses Enter | Shell runs 'ps' command | |
| 2 | 'ps' collects process info for current terminal session | System gathers PID, TTY, TIME, CMD | |
| 3 | 'ps' formats and prints the process list | Output shows columns PID, TTY, TIME, CMD | PID TTY TIME CMD 1234 pts/0 00:00:00 bash 5678 pts/0 00:00:00 ps |
| 4 | User reads the list or pipes it for further use | Process list is ready for viewing or scripting | |
| 5 | No more processes to list, command ends | Shell prompt returns |
| Variable | Start | After Step 2 | After Step 3 | Final |
|---|---|---|---|---|
| Process List | empty | collected current session processes | formatted for display | displayed to user |
| Output | none | none | process info lines | printed on screen |
ps command lists processes running in your terminal session Syntax: ps Shows columns: PID (process ID), TTY (terminal), TIME (CPU time), CMD (command) Default shows only your session's processes Use options like 'ps aux' to see all processes