Here’s an easy way to get the pid of a running process.
Running the “pidof” command will return the pid(s) for a running program. See sample below,
danny@pandora:~> pidof syslog-ng
2043
danny@pandora:~> pidof acpid
2045
danny@pandora:~> pidof /usr/bin/firefox
14408
danny@pandora:~> pidof /usr/bin/compiz
27164
danny@pandora:~> pidof /bin/bash
27011 17339 16792 16477 15151 14403
Simple right!?
Author comments are in a darker gray color for you to easily identify the posts author in the comments
Dear,
I have a question.Suppose we have two pogramms.The control of child program is in the parent one.I just one to kill the process of child program after a few min or seconds while the Parent programm is running in Linux.Help in this regard would be really appreciated.
do a ps -ef | grep “the process name”
then kill that PID
Dear,
In connection with the above problem ,I don’t know the process name of the child program.Thanks in advance.