Created
May 27, 2016 21:40
-
-
Save brianwhigham/65c42a6f4a6bbad0eee89fd1ddd631fb to your computer and use it in GitHub Desktop.
show amount of used RAM with bash and awk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
free -m | awk 'NR==2{ram=$2; getline; used=$3; printf "%.0f\n", 100-(ram-used)/ram*100 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment