Last active
September 18, 2018 13:34
-
-
Save bepcyc/009ee41e90f87c1c2d490f3b5cabd7f3 to your computer and use it in GitHub Desktop.
Show all processes using swap sorted by amount used
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
#!/bin/bash | |
# based on https://www.cyberciti.biz/faq/linux-which-process-is-using-swap/ | |
for file in /proc/*/status ; do awk '/VmSwap|Name|Tgid:/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 3 -n -r | less |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment