The free command in Linux gives you a quick summary of RAM and swap usage. It reads from /proc/meminfo and displays the data in a single table with one command.
This guide covers how to use the free command in Linux and what each column in its output means.
The basic syntax is:
bashfree [OPTIONS]
Run free without options to see memory and swap in kibibytes (KiB). One kibibyte equals 1024 bytes — not the same as a kilobyte (KB), which is 1000 bytes. The distinction matters when reading output or comparing values from different tools.
bashfree
total used free shared buff/cache availableMem: 8075208 3204964 1310540 551232 3559704 4198340Swap: 2097148 0 2097148
The output has two data rows: one for physical RAM and one for swap.
Each column reports a specific memory measurement:
used = total - free - buffers - cache. This is why used looks high even on a lightly loaded system: buffered and cached memory counts toward the total, not just application memoryThe practical difference: a system showing 50 MB free but 3 GB available has plenty of RAM. Reacting to the free column alone leads to false alarms.
Swap row: zero in the used swap column is the normal and healthy state. When swap usage climbs, the system is moving RAM pages to disk, which degrades performance.
Human-readable format — the most practical option for daily use:
bashfree -h
This auto-selects MB or GB based on the values.
Specific units. --mega uses SI megabytes (powers of 1000); -m uses mebibytes (powers of 1024):
bashfree --mega # megabytes: 1 MB = 1000 KBfree -m # mebibytes: 1 MiB = 1024 KiB
Wide mode splits buff/cache into two separate columns for buffers and cache:
bashfree -h -w
Show column totals — adds a line combining RAM and swap:
bashfree -h -t
Live updates — refresh every N seconds until CTRL+C:
bashfree -h -s 5
Stop after a fixed number of updates with -c:
bashfree -h -s 5 -c 10
For a quick check, free -h is all you need. If available is consistently low relative to total, the system is under memory pressure and may start swapping. Use top or htop when you need per-process memory detail. Leave a comment below if you run into any issues.
The rmmod command in Linux removes a loaded module from the running kernel. Because the kernel has…
The diff command in Linux compares two text files line by line and shows the lines that…
DNS cache is a temporary database your OS and browser build as you browse. Each time you visit a website, the domain-to-IP mapping is saved locally, cutting out the round trip to a remote DNS server on repeat visits. Stale entries are the most common reason to flush the DNS cache: a server moves to a new IP, but your OS or browser still routes to the old address. This guide covers how to clear the DNS cache on Windows, Linux, and macOS, and how to flush the separate cache stored inside Chrome and Firefox. Flush DNS Cache on Windows The command is the same on Windows 10, Windows 11, and earlier supported releases. Open Command Prompt with administrator privileges. Type cmd in the Windows search bar, right-click Command Prompt, and select Run as…
Using a strong, unique password for every account is one of the most effective security…
Ubuntu locks the root account by default. New users often wonder what the root password…
Since Ubuntu 17.10, networking is configured with Netplan rather than the older /etc/network/interfaces file. You write a…