pidof

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

Install

All systems
curl cmd.cat/pidof.sh
Debian Debian
apt-get install sysvinit-utils
Ubuntu
apt-get install sysvinit-utils
Arch Arch Linux
pacman -S procps-ng
image/svg+xml Kali Linux
apt-get install sysvinit-utils
CentOS
yum install sysvinit-tools
Fedora
dnf install procps-ng
Windows (WSL2)
sudo apt-get update sudo apt-get install sysvinit-utils
OS X
brew install pidof
Raspbian
apt-get install sysvinit-utils

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

© tl;dr; authors and contributors