FollieHiyuki-dotfiles/home/.local/bin/info/ram
2021-02-13 19:28:59 +03:00

8 lines
204 B
Bash
Executable File

#!/bin/sh
mem=$(free -k | grep "Mem")
memtotal=$(echo "$mem" | awk -F' ' '{ print $2 }')
memavail=$(echo "$mem" | awk -F' ' '{ print $7 }')
ramu=$(( 100*(memtotal-memavail)/memtotal ))
echo "$ramu%"