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:
$ 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
, andlshw
man pages or documentation for your system for more information.