Last active
May 25, 2018 23:10
-
-
Save fipar/ffcf4b926930ec56664155adebaf75ee to your computer and use it in GitHub Desktop.
Get list of process names using swap in descending order (by swap usage). Assumes swap usage is printed in kb always, which I need to validate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep -r VmSwap /proc/[0-9][0-9]*/status 2>/dev/null|sort -k2 -nr | \ | |
while read procentry meminkb; do | |
pid=$(echo $procentry|awk -F'/' '{print $3}') | |
echo "$(cat /proc/$pid/comm) ($pid): $meminkb" | |
done 2>/dev/null |more |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment