Home  >  Article  >  Operation and Maintenance  >  How to check the memory size in Linux

How to check the memory size in Linux

WBOY
WBOYOriginal
2022-05-31 17:31:0922314browse

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.

How to check the memory size in Linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

How to check the amount of memory in Linuxg

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

How to check the memory size in Linux

Displayed in gb:

How to check the memory size in Linux

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn