ps to show an entire tree.
Using ps aux
to see active processes is helpful and very common. However, using ps auxf
will give an ASCII art representation of the process tree within ps
. Here’s an example:
root 3513 0.0 0.0 7196 1068 ? Ss Nov30 0:00 /usr/sbin/sshd root 5201 0.0 0.0 10092 2968 ? Ss Nov30 0:00 _ sshd: user [priv] user 5207 0.0 0.0 11944 3620 ? S Nov30 0:11 | _ sshd: user@pts/1 user 5208 0.0 0.0 5724 2584 pts/1 Ss Nov30 0:02 | _ -bash user 14745 0.0 0.0 5724 1524 pts/1 S 16:42 0:00 | _ -bash user 14746 0.0 0.0 3800 500 pts/1 S 16:42 0:00 | | _ sleep 100 user 15370 0.0 0.0 5724 1524 pts/1 S 16:52 0:00 | _ -bash user 15371 0.0 0.0 3800 472 pts/1 S 16:52 0:00 | | _ sleep 100 user 15596 0.0 0.0 4604 1088 pts/1 R+ 16:56 0:00 | _ ps auxf root 5597 0.0 0.0 10092 2976 ? Ss Nov30 0:00 _ sshd: user [priv] user 5600 0.0 0.0 10244 1844 ? S Nov30 0:00 | _ sshd: user@pts/2 user 5601 0.0 0.0 5720 2536 pts/2 Ss+ Nov30 0:00 | _ -bash root 8833 0.0 0.0 10092 2976 ? Ss 15:17 0:00 _ sshd: user [priv] user 8835 0.0 0.0 10092 1824 ? S 15:17 0:00 _ sshd: user@pts/3 root 8836 0.0 0.0 4632 1368 pts/3 Ss+ 15:17 0:00 _ /bin/sh
You can see three pseudo terminals created by sshd
and a few bash scripts that are running.