free
Commandfree
The free
command is used to display information about system memory usage, including total, used, free, shared, buffer/cache, and available memory. This command helps in monitoring memory consumption on a Linux system.
free [OPTION]...
free
-h
(Human-readable)Display memory sizes in a human-readable format (e.g., KB, MB, GB):
free -h
-b
(Bytes)Display memory sizes in bytes:
free -b
-k
(Kilobytes)Display memory sizes in kilobytes (default):
free -k
-m
(Megabytes)Display memory sizes in megabytes:
free -m
-g
(Gigabytes)Display memory sizes in gigabytes:
free -g
-s
seconds (Continuous Mode)Display memory usage at regular intervals in seconds:
free -s 5
-t
(Total)Display a line showing the total memory usage:
free -t
--help
Display help information for the command:
free --help
--version
Display the version information of the command:
free --version
free
Commandfree
This command displays the total, used, free, shared, buffer/cache, and available memory.
free -h
This command shows memory usage in a more readable format with units (KB, MB, GB).
free -s 5
This command updates the memory usage display every 5 seconds.
The output of the free
command typically includes the following columns:
Option | Description |
---|---|
-h |
Display memory sizes in human-readable format. |
-b |
Display memory sizes in bytes. |
-k |
Display memory sizes in kilobytes (default). |
-m |
Display memory sizes in megabytes. |
-g |
Display memory sizes in gigabytes. |
-s seconds |
Display memory usage at regular intervals. |
-t |
Display a line showing the total memory usage. |
--help |
Display help information for the command. |
--version |
Display the version information of the command. |