Standard unix command: $ cat /proc/meminfo. Note that /proc/meminfo is a file. You don't actually have to run cat , you can simply read the file.
stackoverflow.com