Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to query server memory by linux

Shulou Source: shulou.com Published: 2022-05-31 12:32:53 10月03日 Update

This article is about how linux queries server memory. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

In linux, you can use the free command to query the server's memory, which can be used to display memory usage, including physical memory, virtual swap file memory, shared memory segments, and buffers used by the system core. The syntax is "free [- bkmotV] [- s]".

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

How to query server memory by linux

The Linux free command is used to display memory status.

The free instruction shows memory usage, including physical memory, virtual swap file memory, shared memory segments, and buffers used by the system core.

Grammar

Free [- bkmotV] [- s]

Parameter description:

-b displays memory usage in Byte units.

-k displays memory usage in KB units.

-m displays memory usage in MB units.

-h displays memory usage in appropriate units, up to a maximum of three digits, and automatically calculates the corresponding unit value. The units are:

B = bytes

K = kilos

M = megas

G = gigas

T = teras

-o the buffer adjustment column is not displayed.

-s continuously observe memory usage.

-t displays the memory sum column.

-V displays version information.

Example

Display memory usage

The free command defaults to the display unit kb, which can be viewed with the free-m and free-g commands, representing MB and GB, respectively.

In addition, free-h will automatically choose to display in units of capacity that are suitable for understanding.

Thank you for reading! This is the end of this article on "how to query server memory in linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Memory unit situation command server service query system buffer buffer content section entity file more core article syntax good appropriate Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Redmi vpn Huawei Xiaomi