Skip to content

Instantly share code, notes, and snippets.

@Bklyn
Created October 10, 2014 15:33
Show Gist options
  • Save Bklyn/a15cd82b2fc1b13a1f88 to your computer and use it in GitHub Desktop.
Save Bklyn/a15cd82b2fc1b13a1f88 to your computer and use it in GitHub Desktop.
Swap space usage by process
perl -ne 'chomp; $name=$1 if /Name:\s+([^ ]+)/; $pid=$1 if /^Pid:\s+(\d+)/; \
printf "%-16s %5d %16s\n", $name, $pid, $1 if /VmSwap:\s*([1-9]\d*) kB/' /proc/*/status 2> /dev/null | \
sort -rn -k3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment