Skip to content

Instantly share code, notes, and snippets.

@pichuang
Created June 10, 2014 13:44
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 pichuang/fe1a2d0dfb1aabb79a8e to your computer and use it in GitHub Desktop.
Save pichuang/fe1a2d0dfb1aabb79a8e to your computer and use it in GitHub Desktop.
Display oom_killer all process oom_score
#!/bin/bash
for proc in $(find /proc -maxdepth 1 -regex '/proc/[0-9]+'); do
printf "%2d %5d %s\n" \
"$(cat $proc/oom_score)" \
"$(basename $proc)" \
"$(cat $proc/cmdline | tr '\0' ' ' | head -c 50)"
done 2>/dev/null | sort -nr | head -n 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment