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>
$ 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.
See you on next post.