Skip to content

Instantly share code, notes, and snippets.

@efasel
Created February 8, 2016 16:52
Show Gist options
  • Save efasel/2d56652d08316a1c0930 to your computer and use it in GitHub Desktop.
Save efasel/2d56652d08316a1c0930 to your computer and use it in GitHub Desktop.
sorted list of processes with amount of swapped memory
#!/bin/bash
for pid in $(cd /proc && find . -maxdepth 2 -type f -name status | grep -o '[0-9]*'); do grep -q VmSwap /proc/$pid/status > /dev/null 2>&1 && echo -n "$(grep VmSwap /proc/$pid/status)" && ps h -p $pid -o args ; done | sort -k 2 -n -r | cut -c 1-200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment