2025-03-14 21:59:59 -06:00
|
|
|
# pidof
|
|
|
|
|
|
|
|
|
|
> Get the ID of a process using its name.
|
2026-07-08 16:22:34 -06:00
|
|
|
> See also: `pgrep`.
|
2025-03-14 21:59:59 -06:00
|
|
|
> 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}})`
|