BASH - Show SWAP Usage.sh: Difference between revisions
From IT-Arts.net
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>" |
m Text replacement - "Category:Post-It" to "Category:Wiki" |
||
| Line 1: | Line 1: | ||
[[Category: | [[Category:Wiki]] | ||
<nowiki> | <nowiki> | ||
Revision as of 07:17, 9 December 2025
#!/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
