- Find Ram Size in Linux Using free And top Commands
- Use /proc/meminfo file to find ram size in Linux
- Use free Command to check RAM size
- The free command options
- Finding free and used ram info using the vmstat command
- The top Command
- GUI system information tool
- Say hello to dmidecode Command
- Related media
- Conclusion
- 4 ways to check the size of physical memory (RAM) in Linux
- 1. Using free command
- 2. Using /proc/meminfo file
- 3. Using top command
- 4. Using vmstat
- Информация об оперативной памяти в Linux. Свободная, занятая и тип памяти
- Свободная и занятая оперативная память
- Команда free
- Команда vmstat
- Команда top
- Команда htop
- Файл /proc/meminfo
- Тип памяти и частота
- Заключение
- Linux Check Ram Speed and Type Commands
- Linux check ram speed and type commands
- Installation
- How to check ram speed and type on Linux or Unix-like system
- Say hello to lshw
Find Ram Size in Linux Using free And top Commands
Use /proc/meminfo file to find ram size in Linux
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | None |
Est. reading time | 5m |
The /proc/meminfo file tells you about memory usage on the server. This file is used by the free command and many other Linux commands to display the amount of free and used memory (both physical and swap) on the system as well as the shared memory and buffers used by the kernel. Type the following cat command/less command to view total installed ram and used ram, enter:
$ less /proc/meminfo
OR
$ cat /proc/meminfo
Sample outputs:
Of course, we can use the grep command/egrep command as follows to filter out information:
Use free Command to check RAM size
Free command is a frontend to /proc/meminfo file. It provides more human-readable output to show you the total amount of free and used physical and swap memory in the system, as well as the buffers used by the kernel, run:
$ free -m
OR
$ free -g
Sample outputs:
The free command options
From the free(1) man page:
Hence, we try those options too:
$ free
$ free -m
$ free -g -t -o
$ free -t
$ free -o
Finding free and used ram info using the vmstat command
The vmstat command can display memory statistics including additional information about processes, paging, block IO, traps, and cpu activity. Pass the -s option to the vmstat to show us memory statistics as follows:
$ vmstat -s
Sample outputs:
The top Command
The top command provides a dynamic real-time view of a running system including a quick summary information about RAM, CPU as well as a list of tasks currently being managed by the Linux kernel. Type the following command:
$ top
Sample outputs:
Fig.01: Display Linux RAM Size with the top commad
GUI system information tool
The System Monitor Gnome or KDE application enables you to display basic system information and monitor system processes, usage of system resources, and file systems. You can start System Monitor in the following ways:
Click on System menu > Choose Administration > System Monitor
Alternatively, type the following command:
$ gnome-system-monitor
Sample outputs:
Linux view installed memory with the System Monitor application
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Say hello to dmidecode Command
The dmidecode command is used for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. To see complete information about memory, enter:
$ sudo dmidecode —type memory
Sample outputs:
Related media
This tutorial is also available in a quick video format:
Conclusion
In this tutorial, you learned how to use the various command line and GUI tools amount of free and used memory in the Linux system. See free and vmstat command man page here and here:
man free
man vmstat
man top
man htop
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
4 ways to check the size of physical memory (RAM) in Linux
Published: September 19, 2017 | Modified: June 20, 2020
An article explaining how to check physical memory (RAM) in the Linux server. 4 different commands to get memory information from the Linux server.
In this article we will see basic commands to check physical memory on a server in Linux. Many beginners struggle with knowing their system well in context to resources like CPU, Memory, disks, etc. So I decided to write this small article pinpointing commands to check RAM on the Linux server. These commands will work in different flavors of Linux like Red Hat, CentOS, Suse, Ubuntu, Fedora, Debian, etc.
Without much delay lets dive into commands –
1. Using free command
The first command is free. This is the simplest command to check your physical memory. This command is mainly used for checking RAM and SWAP on the system. Using different switch you can change the byte-format of output. Like -b for bytes, -k for kilobytes, -m for megabytes and -g for gigabytes.
Check row with Mem: and number against it. That’s the physical RAM of your server.
In the above output you can see the system is installed with 125GB of physical RAM (observe highlighted rows). By using a different switch -b , -k , -m and -g output changed numbers according to selected byte-format.
2. Using /proc/meminfo file
Another way is to read memory info from the proc filesystem. /proc/meminfo is the file you should read to get detailed information about memory. The very first line or line starts with MemTotal is your total physical memory on the server.
As you can see from output, memory is displayed in kilobytes.
3. Using top command
The famous top command also lists physical memory information in a very clear way. In the upper section of the top command output lies the CPU, Memory, and SWAP information.
I clipped the above section of the top command output in the above example. Check second last line saying Mem: (highlighted row). This shows physical memory in kilobytes. You can see the total, used, and free portions of it. Total is your actual RAM installed on the server.
4. Using vmstat
Another way is to use vmstat (virtual memory stats) command with -s switch. This will list memory in detail with the first-line being total memory on the server.
Memory is displayed in kilobytes by default. The very first line shows you total memory on the server.
Источник
Информация об оперативной памяти в Linux. Свободная, занятая и тип памяти
В этой статье мы рассмотрим, как получить информацию об оперативной памяти (RAM) в Linux.
Мы воспользуемся утилитами командной строки доступными для большинства Linux дистрибутивов.
Свободная и занятая оперативная память
Для получения информации о количестве свободной и занятой оперативной памяти в Linux можно использовать различные утилиты и команды. Рассмотрим несколько распространенных способов.
Команда free
Команда free очень простая, она выводит информацию о общем количестве оперативной памяти, о количестве занятой и свободной памяти, а также об использовании файла подкачки.
По умолчанию объем памяти выводится в килобайтах. Используя опции, можно выводить объем памяти в других форматах. Некоторые опции:
- -m — в мегабайтах
- -g — в гигабайтах
- -h — автоматически определить формат
Команда vmstat
Команда vmstat выводит различную статистику по использованию памяти. Используя ключ -s можно вывести подробную статистику в табличном виде.
Команда top
top — это утилита командной строки, которая используется для мониторинга процессов и используемых ресурсов компьютера.
Запуск утилиты top :
В заголовке выводится информация об использованной оперативной памяти.
Команда htop
Утилита htop, также как и top, используется для мониторинга ресурсов и процессов.
Для установки утилиты htop в Ubuntu Linux (Linux Mint и других Ubuntu/Debian-дистрибутивах) выполните команду:
Запуск утилиты htop :
Файл /proc/meminfo
Описанные выше команды, в качестве источника информации используют системные файлы из файлов, хранящихся в виртуальной файловой системе /proc . В файле /proc/meminfo содержится информация об использовании памяти. Выведем содержимое файла /proc/meminfo :
Тип памяти и частота
Рассмотрим, как получить информацию об установленных в компьютер модулях оперативной памяти. Воспользуемся командной dmidecode
Используем следующую команду:
В выводе команды будет информация о слотах оперативной памяти. Для каждого слота отображается установленный модуль оперативной памяти, его тип (поле Type ), размер (поле Size ), скорость/частота (поле Speed ) и другая информация.
В зависимости от системы и оборудования не всегда удается получить все данные, поэтому некоторые поля могут быть пустыми или иметь надписи Not provided/Unknown.
Заключение
Мы рассмотрели различные способы для просмотра информации о доступной и занятой оперативной памяти, а также показали, как вывести информацию об установленных модулях оперативной памяти.
Для отслеживания использования ресурсов компьютера существует множество графических программ. Найти их можно в нашем каталоге программ для Linux в разделе Система/Мониторинг.
Источник
Linux Check Ram Speed and Type Commands
H ow do I check RAM speed and type (line DDR or DDR2 or DDR3 or DDR4) without opening my computer? I need to purchase RAM and I need to know the exact speed and type installed. How do I find out ram information from a shell prompt? How can I check ram speed in Linux?
You need to use biosdecode command line utility. Dmidecode is a tool or dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | Yes |
Requirements | None |
Est. reading time | 1m |
The output contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. This command works on Linux, UNIX and *BSD based computers.
Linux check ram speed and type commands
The procedure is as follows:
- Open the terminal application or log in using ssh command.
- Type the “ sudo dmidecode —type 17 ” command.
- Look out for “Type:” line in the output for ram type and “Speed:” for ram speed.
Installation
Use the apt command/apt-get command to install dmidecode on a Debian or Ubuntu Linux:
sudo apt install dmidecode
Fedora Linux user, type the following dnf command:
sudo dnf install dmidecode
CentOS/RHEL/Oracle Linux user, run the following yum command:
sudo yum install dmidecode
SUSE/OpenSUSE user, run the following zypper command:
sudo zypper install dmidecode
How to check ram speed and type on Linux or Unix-like system
Open a shell prompt and type the following command as root user:
$ sudo dmidecode —type 17
OR
$ sudo dmidecode —type 17 | more
Sample output:
You can just grep speed (see grep command) and skip all other the details using the following syntax:
- No ads and tracking
- In-depth guides for developers and sysadmins at Opensourceflare✨
- Join my Patreon to support independent content creators and start reading latest guides:
- How to set up Redis sentinel cluster on Ubuntu or Debian Linux
- How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
- How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
- A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
- How to protect Linux against rogue USB devices using USBGuard
Join Patreon ➔
Say hello to lshw
You can use the following command too:
$ sudo lshw -short -C memory
Sample outputs:
Another outputs from my work laptop:
Finding the frequency and type of my current RAM in Linux
Conclusion
You learned how to find out ram speed and other information using Linux and Unix terminal commands.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Category | List of Unix and Linux commands |
---|---|
Documentation | help • mandb • man • pinfo |
Disk space analyzers | df • duf • ncdu • pydf |
File Management | cat • cp • less • mkdir • more • tree |
Firewall | Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04 |
Linux Desktop Apps | Skype • Spotify • VLC 3 |
Modern utilities | bat • exa |
Network Utilities | NetHogs • dig • host • ip • nmap |
OpenVPN | CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04 |
Package Manager | apk • apt |
Processes Management | bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop |
Searching | ag • grep • whereis • which |
Shell builtins | compgen • echo • printf |
Text processing | cut • rev |
User Information | groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w |
WireGuard VPN | Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04 |
Comments on this entry are closed.
lol; i like you’re site and your howto’s very very much. However, now I know I have to follow your stuff with an unknown type of ram, at an unknown speed. lol
seriously, keep up the good work! 😀
If only there was a way to see what rank it is too :(.
I’m using Ubuntu 8.10 alpha 3 32bits.
Using dmidecode I get the following results:
jp@jp-desktop810:
$ sudo dmidecode –type 17
[sudo] password for jp:
# dmidecode 2.9
SMBIOS 2.2 present.
Invalid entry length (0). DMI table is broken! Stop.
$ sudo dmidecode –type 17 | more
# dmidecode 2.9
SMBIOS 2.2 present.
Invalid entry length (0). DMI table is broken! Stop.
So, dmidecode is same version, SMBIOS is 2.2 instead of 2.4. And I didn’t get the information from dmidecode.
You may need to report bug to Ubuntu team. There is not much we can do to fix this issue.
I get only this:
# dmidecode 2.9
SMBIOS 2.3 present.
and no more info!
Tried both commands.
How can i get info like size, speed, type etc. ?
dmidecode –type memory
This should work as well 🙂
You can try using the following command combination and see if that works:
dmidecode |grep -A20 ^Memory
Gagan Brahmi,
Thanks, works well. 😛
I am using Fedora 9. 2.6.25.14-108.fc9.i686
Intel(R) Pentium(R) 4 CPU 3.00GHz
Here is the dmidecode –type 17 output.
No type and speed info.
# dmidecode 2.9
SMBIOS 2.3 present.
Handle 0x0028, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0027
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: None
Locator: A0
Bank Locator: Bank0/1
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None
Handle 0x0029, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0027
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: A1
Bank Locator: Bank2/3
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None
Handle 0x002A, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0027
Error Information Handle: Not Provided
Total Width: 64 bits
Data Width: 64 bits
Size: 1024 MB
Form Factor: DIMM
Set: None
Locator: A2
Bank Locator: Bank4/5
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None
Handle 0x002B, DMI type 17, 27 bytes
Memory Device
Array Handle: 0x0027
Error Information Handle: Not Provided
Total Width: Unknown
Data Width: Unknown
Size: No Module Installed
Form Factor: DIMM
Set: None
Locator: A3
Bank Locator: Bank6/7
Type: Unknown
Type Detail: None
Speed: Unknown
Manufacturer: None
Serial Number: None
Asset Tag: None
Part Number: None
What will be the problem?
Is this a white box?? That is what I can make out. Just try the following command to see the server model:
dmidecode –type system
or
dmidecode –type 1
Источник