From af32b0ea7db369742cbdb883f377fbe904b1cf54 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Sat, 1 Oct 2016 00:17:07 -0500 Subject: [PATCH] Add List Parent pid With ps as a unix til --- README.md | 3 ++- unix/list-parent-pid-with-ps.md | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 unix/list-parent-pid-with-ps.md diff --git a/README.md b/README.md index f0ec6d5..cbcd71c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really warrant a full blog post. These are mostly things I learn by pairing with smart people at [Hashrocket](http://hashrocket.com/). -_475 TILs and counting..._ +_476 TILs and counting..._ --- @@ -431,6 +431,7 @@ _475 TILs and counting..._ - [List All Users](unix/list-all-users.md) - [List Names Of Files With Matches](unix/list-names-of-files-with-matches.md) - [List Of Sessions To A Machine](unix/list-of-sessions-to-a-machine.md) +- [List Parent pid With ps](unix/list-parent-pid-with-ps.md) - [Only Show The Matches](unix/only-show-the-matches.md) - [Open The Current Command In An Editor](unix/open-the-current-command-in-an-editor.md) - [Partial String Matching In Bash Scripts](unix/partial-string-matching-in-bash-scripts.md) diff --git a/unix/list-parent-pid-with-ps.md b/unix/list-parent-pid-with-ps.md new file mode 100644 index 0000000..81cf266 --- /dev/null +++ b/unix/list-parent-pid-with-ps.md @@ -0,0 +1,13 @@ +# List Parent pid With ps + +The `ps` command, which stands for `process status`, is a great way to find +different processes running on a machine. Information like their `pid` +(_process id_) is included. If you are tracking down a process to kill and +find that that process is an unkillable zombie, then you may need to +simultaneously kill the process' parent as well. + +So, you'll need the parent `pid` as well. You can get both the `pid` and the +parent `pid` of a process by including the `-f` flag with `ps`. + +You may also want to include the `-e` flag to make sure that information +about other users' processes is included in the results.