diff --git a/pages/linux/pidof.md b/pages/linux/pidof.md new file mode 100644 index 0000000000..68057f1cb4 --- /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}})" `