The free command
Display amount of free and used memory in the system 4 examples from the lessons of the IVski Linux Playground — try them in the terminal next to them.
Options in the examples
-m, --mebi- Display the amount of memory in mebibytes.
-h, --human- Show all output fields automatically scaled to shortest three digit unit and display the units of print out.
-s, --seconds delay- Continuously display the result delay seconds apart.
Examples
free -hHuman readable (MB/GB)
free -mIn megabytes
free -s 2Update every 2 seconds
free -m | awk '/Mem/ {print $3}'Memory used, in MB