In Linux, you can use the free command to check how many grams of memory there are. This command is used to display the memory status of the system. When the parameter is set to "-g", the unit of "GB" is used in the displayed results. To display, the syntax is "free -g"; this command will not display decimals, and the result will be automatically rounded.
#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
The Linux free command is used to display the memory status.
Decimals will not be displayed and will be rounded automatically
The free command will display memory usage, including physical memory, virtual swap file memory, shared memory segments, and buffers used by the system core wait.
Syntax
free [-bkmotV][-s <间隔秒数>]
Parameter description:
-b Displays the memory usage in Byte.
-k Displays memory usage in KB.
-m Displays memory usage in MB.
-h Display memory usage in appropriate units, up to three digits, and automatically calculate the corresponding unit value. The units are: B = bytes, K = kilos, M = megas, G = gigas, T = teras
The example is as follows:
Display memory usage
Displayed in gb:
Recommended learning:Linux video tutorial
The above is the detailed content of How to check the memory size in Linux. For more information, please follow other related articles on the PHP Chinese website!