Skip to content

Instantly share code, notes, and snippets.

@bepcyc
Last active September 18, 2018 13:34
Show Gist options
  • Save bepcyc/009ee41e90f87c1c2d490f3b5cabd7f3 to your computer and use it in GitHub Desktop.
Save bepcyc/009ee41e90f87c1c2d490f3b5cabd7f3 to your computer and use it in GitHub Desktop.
Show all processes using swap sorted by amount used
#!/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