mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
Update 2025-02-03 Update 2025-02-04 Update 2025-02-09 Update 2025-02-14 Update 2025-02-15 Update 2025-02-22 Update 2025-02-24
15 lines
289 B
Bash
15 lines
289 B
Bash
#!/usr/bin/env bash
|
|
|
|
total="$(free -m | grep Mem: | awk '{ print $2 }')"
|
|
used="$(free -m | grep Mem: | awk '{ print $3 }')"
|
|
|
|
free=$(expr $total - $used)
|
|
|
|
if [ "$1" = "total" ]; then
|
|
echo $total
|
|
elif [ "$1" = "used" ]; then
|
|
echo $used
|
|
elif [ "$1" = "free" ]; then
|
|
echo $free
|
|
fi
|