Skip to content

Instantly share code, notes, and snippets.

@nero
Created June 22, 2022 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nero/2de803ea9651cdc779f18dc8c16c7297 to your computer and use it in GitHub Desktop.
Save nero/2de803ea9651cdc779f18dc8c16c7297 to your computer and use it in GitHub Desktop.
sfpath = io.open("/proc/meminfo", "r")
sf = sfpath:read("*a")
local number = string.match(sf, "MemTotal:%s*(%d+) kB")
print(tonumber(number))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment