From 845162a7cfb91c5dd195249f8940f87ded64b172 Mon Sep 17 00:00:00 2001 From: Howard Yun Date: Tue, 31 Mar 2020 20:41:36 -0400 Subject: [PATCH] pidof: add page (#3948) --- pages/linux/pidof.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pages/linux/pidof.md diff --git a/pages/linux/pidof.md b/pages/linux/pidof.md new file mode 100644 index 000000000..68057f1cb --- /dev/null +++ b/pages/linux/pidof.md @@ -0,0 +1,19 @@ +# pidof + +> Gets the ID of a process using its name. + +- List all process IDs with given name: + +`pidof {{bash}}` + +- List a single process ID with given name: + +`pidof -s {{bash}}` + +- List process IDs including scripts with given name: + +`pidof -x {{script.py}}` + +- Kill all processes with given name: + +`kill "$(pidof {{name}})" `