Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 4
    (assuming the parent process.pl itself has not been reparented by init as well). Note that pkill process.pl would match any process whose name contains process followed by any character followed by pl. You'd need pkill -x 'process\.pl' or pkill '^process\.pl$' for processes whose name is process.pl. Commented May 23, 2013 at 17:06
  • Just make sure you do not kill process number 1! :-) Commented May 23, 2013 at 18:35
  • Thnx, I will experiment a bit to make sure that I don't kill anything important :D Commented May 23, 2013 at 19:40
  • @bbaja42: Any system with pkill on it should have pgrep, too, which has much the same command interface. So, if pgrep -P 1 -x 'process\.pl' lists all of the PIDs you want killed and nothing else, you can be reasonably sure that pkill isn't going to do something unexpected. The main danger then is that your test isn't run at the same time as the actual command, since the process table will be different at execution time. Commented May 23, 2013 at 19:52
  • Thanks, I'm aware of the pkill. I plan to compare output of pgrep and ps faux visually, and if all OK then run the pkill command. Commented May 24, 2013 at 8:24