DBA/Linux/swap.sh
2020-08-11 07:26:47 -05:00

3 lines
182 B
Bash

#!/bin/bash
## Get swap space in Linux using bash for loop ##
for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; done | sort -k 2 -n -r | less