BASH - Show SWAP Usage.sh: Difference between revisions
From IT-Arts.net
m Text replacement - "Category:Post-It" to "Category:Wiki" |
m Text replacement - "Category:Wiki" to "Category:Wiki '''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' " |
||
| Line 1: | Line 1: | ||
[[Category:Wiki]] | [[Category:Wiki]] | ||
'''''[https://it-arts.net/index.php/Category:Wiki Return to Wiki Index]''''' | |||
<nowiki> | <nowiki> | ||
Latest revision as of 08:20, 17 January 2026
#!/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
