Skip to content

Instantly share code, notes, and snippets.

@rye
Created June 15, 2015 16:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rye/682b8b84e4e8fa0da787 to your computer and use it in GitHub Desktop.
Save rye/682b8b84e4e8fa0da787 to your computer and use it in GitHub Desktop.
Print out a list of PID's that are defunct
#!/bin/sh
ruby -e "\"`ps -ef|grep \<defunct\>`\".split(/$/).each{|l|puts(l.match(/^(?<user>\w+)\W+(?<pid>\d+)\W+(?<ppid>\d+)/)[:pid])}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment