Eu geralmente gosto de usar ps auxf
porque ele mostra visualmente os processos filhos sob o pai visualmente:
$ ps auxf
...
root 637 0.0 0.0 110044 800 tty1 Ss+ 02:50 0:00 /sbin/agetty --noclear tty1 linux
root 983 0.0 0.1 404028 1136 ? Sl 02:50 0:11 /usr/sbin/VBoxService --pidfile /var/run/vboxadd-service.sh
root 1013 0.0 1.6 562416 16444 ? Ssl 02:50 0:03 /usr/bin/python -Es /usr/sbin/tuned -l -P
root 1015 0.0 0.4 105996 4108 ? Ss 02:50 0:00 /usr/sbin/sshd -D
root 20191 0.0 0.5 152116 5576 ? Ss 10:06 0:00 \_ sshd: vagrant [priv]
vagrant 20193 0.0 0.2 152304 2872 ? S 10:06 0:00 \_ sshd: vagrant@pts/0
vagrant 20194 0.0 0.2 115964 2644 pts/0 Ss 10:06 0:00 \_ -bash
root 20232 0.0 0.2 201844 2956 pts/0 S 10:06 0:00 \_ sudo -Es
root 20233 0.0 0.2 116208 2964 pts/0 S 10:06 0:00 \_ /bin/bash
root 20510 0.0 0.1 151240 1932 pts/0 R+ 11:01 0:00 \_ ps auxf
root 1115 0.0 0.2 91628 2192 ? Ss 02:50 0:00 /usr/libexec/postfix/master -w
postfix 1117 0.0 0.3 91800 4048 ? S 02:50 0:00 \_ qmgr -l -t unix -u
postfix 20149 0.0 0.3 91776 4048 ? S 09:39 0:00 \_ pickup -l -t unix -u
...
Além disso, se você quiser apenas ver a lista de PID + PGID, você pode usar ps
com essas opções assim:
$ ps x -o "%p %r %c"
PID PGID COMMAND
1 1 systemd
2 0 kthreadd
3 0 ksoftirqd/0
5 0 kworker/0:0H
7 0 migration/0
8 0 rcu_bh
...
...
591 591 rngd
594 594 systemd-logind
596 596 smartd
597 597 rsyslogd
600 600 acpid
616 616 abrtd
617 617 abrt-watch-log
630 630 atd
637 637 agetty
983 981 VBoxService
1013 1013 tuned
1015 1015 sshd
1115 1115 master
2426 2426 NetworkManager
2439 2439 dhclient
3123 3123 firewalld
3828 0 kworker/u2:1