The free command parses the /proc/meminfo file for easier analysis of memory usage statistics. Its default behavior is to display the following information about system memory and swap space:
- The total memory.
- The total used.
- The total free.
- The total shared.
- The total buffered and cached.
- The total available for starting new apps (estimated).
The syntax of the free command is:
Memory can be cached, meaning that it is stored temporarily so that the data it contains can be accessed much quicker in the future. The Buffers field in /proc/meminfo indicates memory that is assigned to a specific block device. This memory is used to cache file system metadata, like directory contents, permissions, etc. The Cached memory is similar, but instead of storing file metadata, it stores the actual contents of files. The free command combines these two values together upon output.
free Command Examples
1. To display the memory utilization:
2. To display the memory utilization in bytes:
3. To display the memory utilization in kilo bytes:
4. To display the memory utilization in mega bytes:
5. To display the memory utilization in giga bytes:
6. To display the memory utilization with totals:
7. To display the memory utilization skipping displaying “buffer adjusted”:
8. To display the continuous polling data:
9. To see the detailed high and low statistics for memory usage:
10. To get the version information: