Title: PID of a process
Author: Sandro Tosi
Last modified: 2005-09-20
There are some ways to find the PID of a process.
o pidof <process_name>
given the process_name, ``pidof'' returns the PID of that
process. If there are more than one process running with that name,
it returns a list of PID for the running processes. The
process_name has to be the process name, otherwise it won't match
anything
o ps aux | grep <pattern> | grep -v grep | awk '{ print $2 }'
As ``pidof'', this command line prints the PID or a list of PIDs of
process, but this allows you to use a pattern to select the
processes you need, due to the use of ``grep'' parser.
|