Created
July 2, 2020 20:02
-
-
Save dubcl/2bc1ec5045d26b13614b9afce494ffc9 to your computer and use it in GitHub Desktop.
Show swap apps
This file contains 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
function showswap() { | |
find /proc -maxdepth 2 -path "/proc/[0-9]*/status" -readable -exec awk -v FS=":" '{process[$1]=$2;sub(/^[ \t]+/,"",process[$1]);} END {if(process["VmSwap"] && process["VmSwap"] != "0 kB") printf "%10s %-30s %20s\n",process["Pid"],process["Name"],process["VmSwap"]}' '{}' \; | awk '{print $(NF-1),$0}' | sort -h | cut -d " " -f2- | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment