How to figure out PID of a given binary name?

Hey guys,

How to know what PID is of a given program name? Well, you can use the most well known (maybe) command  “ps -e“. This is gonna list all the available running process, but if know exactly the name of the program (binary) you can pidof command:

$ pidof -x <your process name>

For instance:

$ pidof -x bash

This may be important if you’re creating a script where you need a way to figure out what PID is. You could also use ps but you would have to manage the output which is time consuming.

That’s all,

See you on next post.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s