How to check memory size in GB in Linux

How to check memory size in GB in Linux

To check the memory size in GB on a Linux system, you can use the free command.

Here's an example of how to use free to display the total amount of physical memory (RAM) on the system:

refer to‮iruttual:‬.com
$ free -g

The -g option tells free to display the sizes in gigabytes.

You can also use the cat command to display the memory size from the /proc/meminfo file. For example:

$ cat /proc/meminfo | grep MemTotal

This will display the total amount of physical memory, in kilobytes. To convert the value to gigabytes, you can divide it by 1024.

Another option is to use the lshw command, which displays detailed information about the hardware configuration of the system. To display the memory size with lshw, you can use the following command:

$ lshw -short -C memory

This will display the memory size, as well as other details about the memory modules.

Note: The specific options and syntax for these commands may vary depending on your Linux distribution and version. Consult the free, cat, and lshw man pages or documentation for your system for more information.

Created Time:2017-10-28 21:38:59  Author:lautturi