Find Process ID (PID) of a program in Linux

If you need the ID of a process (PID), you can find it through terminal command. Open the terminal and run following command line:

run ps ax | grep program 

where program must be replaced with program you are searching the PID, for example chrome.

run ps ax | grep chrome

Now output should look like this:

$ ps ax | grep firefox
2112 ?                    S 0:00 /bin/sh /usr/lib/chrome-1.2/chrome
2116 ?                    Sl 514:36 /usr/lib/chrome-1.2/chrome-bin
20290 pts/2           S+ 0:00 grep –color=auto chrome

First number of each field represents Process IF of the program matched by grep, you can ignore the last line which represents grep itself.

Leave a Reply