BASH - Show SWAP Usage.sh

From Wiki.IT-Arts.net
Revision as of 14:23, 3 August 2024 by Admin (talk | contribs) (Created page with "Category:Post-It <nowiki> #!/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</nowiki>")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


#!/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