« Back to Processes: Frequently Asked Questions

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 PROCESSNAME

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
60013

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

Other questions related to Processes

    Related articles

    Like to learn more? Here is a list of articles within the same category or having similar tags.

    Feedback

    Small picture of Michael Boelen

    This article has been written by our Linux security expert Michael Boelen. With focus on creating high-quality articles and relevant examples, he wants to improve the field of Linux security. No more web full of copy-pasted blog posts.

    Discovered outdated information or have a question? Share your thoughts. Thanks for your contribution!

    Mastodon icon