Hacker News new | ask | show | jobs
by ghostpepper 1286 days ago
My go-to incantation is `ps ajxf`, (truncated and edited) sample output below

   PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
      0     1     1     1 ?           -1 Ss       0   0:57 /sbin/init splash
      1   978   978   978 ?           -1 Ss       0   0:00 /usr/sbin/sshd -D
    978 11441 11441 11441 ?           -1 Ss       0   0:00  \_ sshd: ghostpepper [priv]
  11441 11445 11441 11441 ?           -1 S     1000   0:00      \_ sshd: ghostpepper@pts/4
  11445 11446 11446 11446 pts/4    11641 Ss    1000   0:00          \_ -bash
  11446 11641 11641 11446 pts/4    11641 R+    1000   0:00              \_ ps ajxf
Another thing some might not know is that kill (the command / syscall) can send a lot of other signals than KILL (the signal). Not all processes know how to gracefully handle them, so you need to be careful, but for example a lot of daemons can catch SIGHUP and re-load their config file from disk.