From ba53f96ea59e317e1ff1558d8824b896b40022a5 Mon Sep 17 00:00:00 2001 From: Dmytro Shteflyuk Date: Fri, 27 Sep 2019 12:58:21 -0400 Subject: [PATCH] Added "ps-less process tree way" This is based on the fact that the child process holds the PID of the parent process, which is easily accessible through `/proc/PID/status`. Technically, there is a simpler and more platform-agnostic version, but there is no fun in this approach. We can still add it for posterity. ``` :!kill -9 $PPID ``` --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 58e6868..e647656 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,13 @@ Credit: @tomnomnom :!ps axuw | grep vim | grep -v grep | awk '{print $2}' | xargs kill -9 ``` +## The ps-less process tree way +Credit: @kpumuk + +``` +:!grep -P "PPid:\t(\d+)" /proc/$$/status | cut -f2 | xargs kill -9 +``` + ## The ps-less way Credit: @tomnomnom