HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

pidof — Get the ID of a process using its name. More information: <https://manned.org/pidof>.

Submitted by: @import:tldr-pages··
0
Viewed 0 times
thecommandprocessitspidofcliusingget
linux

Problem

How to use the pidof command: Get the ID of a process using its name. More information: <https://manned.org/pidof>.

Solution

pidof — Get the ID of a process using its name. More information: <https://manned.org/pidof>.

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}})

Code Snippets

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}})

Context

tldr-pages: linux/pidof

Revisions (0)

No revisions yet.