Skip to content

Instantly share code, notes, and snippets.

@kshimo69
Created March 3, 2012 14:37
Show Gist options
  • Save kshimo69/1966463 to your computer and use it in GitHub Desktop.
Save kshimo69/1966463 to your computer and use it in GitHub Desktop.
smapsの情報をいい感じに合計して出力する ref: http://qiita.com/items/2980
for i in /proc/[0-9]*; do echo "==== $i ===="; for j in Rss Shared Private Swap; do printf "%-10s" $j; grep $j $i/smaps | awk 'BEGIN{n=0}{n += $2}END{printf "%8s (kB)\n", n}'; done; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment