Skip to content

Instantly share code, notes, and snippets.

@wallyhall
Created June 16, 2020 14:45
Show Gist options
  • Save wallyhall/95edfce51eb9960c44d367b63c965de7 to your computer and use it in GitHub Desktop.
Save wallyhall/95edfce51eb9960c44d367b63c965de7 to your computer and use it in GitHub Desktop.
Approximately real free memory on Linux
#!/bin/sh
cat /proc/meminfo | awk 'BEGIN { i=0; } { if ( /^(MemFree|Buffers|Cache): *(\d*)/ ) { i += $2 ; } } END { print i / 1024 / 1024 " GB" }'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment