blob: 1e4cf89f048550705c837d2cc04760d2bb1f5c79 [file] [log] [blame]
Samuel Shuert3f828662024-02-10 20:45:50 -05001#!/bin/sh
2
3
4total="$(free -m | grep Mem: | awk '{ print $2 }')"
5used="$(free -m | grep Mem: | awk '{ print $3 }')"
6
7free=$(expr $total - $used)
8
9if [ "$1" = "total" ]; then
10 echo $total
11elif [ "$1" = "used" ]; then
12 echo $used
13elif [ "$1" = "free" ]; then
14 echo $free
15fi