Ubuntu,  Unix

Linux and Free Memory Space

The free command in Linux is used to show memory utilization. When run without any options, you can see the used and available space of swap and physical memory. By default, the option is displayed in kilobytes but when run with a -b option it is shown in bytes or -m will show in megabytes or -g in gigabytes or -t in terabytes. So to see the free space in bytes run the following:

free -b

The -o option shows the output adjusted for the buffer. The -t option also adds a total column as well as a line for total that shows swap and physical, combined. The -s will update the output and is followed by a number of seconds. To see the number of times it happened, use the -c option. So to see the output every 60 seconds:

free -cs 60

The low and high stats are shown using the -l option:

free -l

As with many commands, you can see the version of the command using the -V option:

free -V

Finally, use the –help option to see the available options, no matter the version or OS.