BASH - Show SWAP Usage.sh

From IT-Arts.net
Revision as of 07:17, 9 December 2025 by Admin (talk | contribs) (Text replacement - "Category:Post-It" to "Category:Wiki")


#!/bin/sh
#
# LIST SWAP USAGE BY APPLICATION

for file in /proc/*/status ; do grep -q "VmSwap" $file;if [ $? -eq 0 ]; then awk '/VmSwap|Name/{printf $2 " " $3}END{ print ""}' $file; fi done|grep -v '0 kB' | sort -k 2 -n

exit 0