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.

3
  • For me, pgrep myscriptname.py doesn't capture any of the instances of the script. I'm on Ubuntu 14.04. Commented Jul 7, 2017 at 8:30
  • It does not make sense to me that you once grep fpr python and once for the script name. How is that supposed to work? Of course, it is a general problem that scripts can be called directly and indirectly. Commented Apr 29, 2023 at 14:40
  • @HaukeLaging I approached the question of "kill all python scripts except script called test.py" in sequence, by finding all of the python scripts (assuming that part works as intended) and then filtering out the one they want to keep. Is your concern around pgrep python not finding "all python scripts"? Commented Apr 30, 2023 at 15:23