Linux is one of the most popular open source operating system and comes with huge set of commands. The most important and single way of determining the total available space of the physical memory and swap memory is by using “free” command.
The Linux “free” command gives information about total used and available space of physical memory and swap memory with buffers used by kernel in Linux/Unix like operating systems.
This article provides some useful examples of “free” commands with options, that might be useful for you to better utilize memory that you have.
Free command used to check the used and available space of physical memory and swap memory in KB. See the command in action below.
Free command with option -b, display the size of memory in Bytes.
Free command with option -k, display the size of memory in (KB) Kilobytes.
To see the size of the memory in (MB) Megabytes use option as -m.
Using -g option with free command, would display the size of the memory in GB(Gigabytes).
Free command with -t option, will list the total line at the end.
By default the free command display “buffer adjusted” line, to disable this line use option as -o.
The -s option with number, used to update free command at regular intervals. For example, the below command will update free command every 5 seconds.
The -l switch displays detailed high and low memory size statistics.
The -V option, display free command version information.
Top Command, Find Command, Netstat Command.
Good beginner info on how to read the memory usage in Linux.