7 lines
183 B
Bash
Executable file
7 lines
183 B
Bash
Executable file
#!/bin/sh
|
|
|
|
swap_used_kib=$(awk '/SwapTotal/ {total=$2} /SwapFree/ {free=$2} END {print total - free}' /proc/meminfo)
|
|
|
|
swap_used_mib=$((swap_used_kib / 1024))
|
|
|
|
echo "${swap_used_mib}"
|