]"."/> ]".">
Home >Operation and Maintenance >Linux Operation and Maintenance >How to query server memory in Linux
In Linux, you can use the free command to query the server's memory. This command can be used to display memory usage, including physical memory, virtual swap file memory, shared memory sections, and the system core. Buffer, etc., the syntax is "free [-bkmotV][-s
]".
The operating environment of this tutorial: linux7.3 system, Dell G3 computer.
How to query server memory in Linux
The Linux free command is used to display the memory status.
The free command will display memory usage, including physical memory, virtual swap file memory, shared memory segments, and buffers used by the system core.
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
#-o Does not display the buffer adjustment column.
-s
-t Display the memory sum column.
-V Display version information.
Example
Display memory usage
free command default It is the display unit kb, which can be viewed using the free -m and free -g commands, which represent MB and GB respectively
In addition, free -h will automatically choose to display the capacity unit in a suitable understanding
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of How to query server memory in Linux. For more information, please follow other related articles on the PHP Chinese website!