« Back to Processes: Frequently Asked Questions

How to find all process IDs by its process name

To 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

Relevant FAQ: How to kill a running process by its name?

Other questions related to Processes


Is the described answer not working or incorrect, got another tip or question? Share your thoughts!