How to find all process IDs by its process name
How to find the process ID (PID) by its process name?
Use the pidof command to search for processes by their process name.
pidof PROCESSNAMETo get the PID of a process, use the pidof command. If there are multiple processes with the same name, then all PIDs will be displayed.
Examples using pidof
Run pidof followed by the process name that you want to search for. If there is a match, the command will be display the related process ID or IDs.
# pidof nginx
60013 60012 51055
To get only one PID returned, use the pidof command with the -s option.
# pidof -s systemd
60013
Relevant FAQ: How to kill a running process by its name?