Skip to content

Instantly share code, notes, and snippets.

@drinkcat
Last active December 27, 2015 03:39
Show Gist options
  • Save drinkcat/7260798 to your computer and use it in GitHub Desktop.
Save drinkcat/7260798 to your computer and use it in GitHub Desktop.
Sample ps -eafj
UID PID PPID PGID SID C STIME TTY TIME CMD
root 1857 1 1857 1857 0 Oct29 ? 00:00:00 /usr/sbin/sshd
root 4601 1857 4601 4601 0 Oct29 ? 00:00:00 \_ sshd: chronos [priv]
chronos 4603 4601 4601 4601 0 Oct29 ? 00:02:38 | \_ sshd: chronos@pts/0
chronos 4604 4603 4604 4604 0 Oct29 pts/0 00:00:00 | \_ -bash
root 9140 4604 9140 4604 0 13:47 pts/0 00:00:00 | | \_ sudo enter-chroot -n wheezy sh -ec dd if=/dev/
root 9143 9140 9140 4604 0 13:47 pts/0 00:00:00 | | \_ /bin/sh -e /usr/local/bin/enter-chroot -n
root 9335 9143 9140 4604 0 13:47 pts/0 00:00:00 | | \_ su -s /bin/sh -c export SHELL='/bin/ba
chronos 9336 9335 9336 9336 0 13:47 ? 00:00:00 | | \_ -su -c export SHELL='/bin/bash';'s
chronos 9340 9336 9336 9336 0 13:47 ? 00:00:00 | | \_ sh -ec dd if=/dev/zero bs=4800
chronos 9341 9340 9336 9336 0 13:47 ? 00:00:00 | | \_ dd if=/dev/zero bs=48000 c
chronos 9342 9340 9336 9336 0 13:47 ? 00:00:00 | | \_ aplay -fdat -v
@dnschneid
Copy link

#!/bin/sh -e
ps -opgid= "$$"
su -c 'ps -opgid= $$' - dnschneid

Output:

15745
15745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment