/ factorpad.com / tech / linux-essentials / free-command.html
An ad-free and cookie-free website.
Beginner
Learn to find used and free RAM memory at the Linux command line.
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux free Command Summary with Examples (3:12)
Our fifty-third word, or command to memorize is
free
from our category
System.
free
allows you to display memory in
system RAM.
-options | description |
---|---|
--help |
Print help screen |
-m ,
-mega |
Report memory in megabytes |
-h ,
--human-readable |
Print memory with labels |
Recall from the last three videos we've been reviewing memory usage on disks, now we'll shift the focus to memory in RAM.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The free
command has
14 options and here there are no arguments, because
you're just focused on one thing, RAM.
Like most commands, help is available with double-dash
--help
. The
-m
option is used for megabytes, and
-h
reports human-readable output
with M for megabytes, G for
gigabytes, and so on.
So why is free
an important command?
Well, if your system is sluggish, free
will help you identify if a process is, in fact, eating up system
resources.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. Let's go optionless.
And see the output, it's pretty easy. This is fine, but a little tough to decipher, right?
Next, the -m
option will show the
same information in megabytes, which is easier to review quickly.
Seventeen hundred megabytes in RAM total, thirteen-hundred free. And here we'll just focus on these two figures for now.
And last, let's run free
again using
the human-readable option -h
.
Notice how this is the easiest form to grasp. 1.7 Gigs total, 1.2 Gigs free, some megabyte measures here. Not bad, huh?
Okay now you know how to use free
.
And you know the syntax for commands, options and arguments.
One last tip about the free
command.
So another option to keep in mind, is the
-g
option which presents everything
in gigabytes, if you are in a high memory environment.
Okay, thanks for visiting today. I hope this was a helpful
introduction to the free
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
Our YouTube Channel and website are in growth mode. Join the party. Subscribe and follow.
du
command,
hit Back.pg
, click
Next./ factorpad.com / tech / linux-essentials / free-command.html
A newly-updated free resource. Connect and refer a friend today.