Zendo

Restart audio (Fedora)

systemctl --user restart pipewire

Kill a process and its descendants

kill -- $(ps -o 'pgid=' -p "$(pgrep -f 'PROGRAM TITLE' | xargs)" | uniq | xargs -IX echo -X | xargs)
  1. $(pgrep -f 'PROGRAM TITLE' | xargs)
    • Get PID of processes you want to kill based on a match against the full title of the program
    • Use xargs to convert multi-line input to a single line
  2. $(ps -o 'pgid=' -p "123 456 789" | uniq | xargs -IX echo -X | xargs)
    • ps -o 'pgid=' -p ... prints out the PGID (Process group ID) without any headings pgid= of the process IDs 123, 456, and 789
    • uniq removes duplicate lines from the output
    • xargs -IX echo -X Prefix each PGID with a -
      • -IX tells xargs to replace letter X with a value from the input.
      • -NUMBER to kill, ps and friends, means to match processes against the PGID as opposed to the PID
    • xargs changes the multi-line output to be a single line, space separated
  3. kill -- -998 -991
    • -- Tells kill that all option arguments have ended (so that it does not confuse -998 with a signal such as -9 (-SIGKILL)