On 13/6/23 04:52, The Wanderer wrote:
On 2023-06-12 at 16:45, Bret Busby wrote:On 13/6/23 04:30, The Wanderer wrote:On 2023-06-12 at 16:06, Mick Ab wrote:I wish to obtain information about the RAM installed on my PC using the command line. The information needed is :- Total RAM stored Number of sticks used and amount of RAM on each stick Type of RAM e.g. DDR4 Speed of RAM e.g. 3200 MHz Manufacturer and model number of RAM I have seen the dmidecode command being used, but the reliability of the information returned is not reliable. Is there any command that will reliably give the required RAM information ?There are probably multiple ways to get it, but the first one that comes to my mind involves the 'hwinfo' command, from the package of the same name. I don't remember exactly how I invoked it, but I have a historical trail of files listing the hardware specifications of my last few machines as they've changed over time, each generated from the output of that command. If I search the latest such file for "DIMM", I see two entries, each for a different DIMM (i.e., "RAM stick"), each with multiple data items. The fact that there are two of them gives you the "number of sticks used" you asked for. Those entries are sub-entries of a larger entry called "memory", which has a data item called "size", which is the "total RAM" you asked for. One of the data items in each sub-entry is "product", which appears as if it might be the "model number" you asked for. (It certainly looks like a model number, anyway.) Another is "vendor", which appears to be the "manufacturer" you asked for. Another is "size", which gives you the "amount of RAM on each stick" you asked for. Another is "clock", which is the "speed of RAM" you asked for. Another is "description", which at least in my case specifies (as part of what appears to be a freeform string) that the DIMMs I'm looking at are DDR4. I don't see that information specified anywhere else in the listing.From the above, whilst this computer is running Linux Mint Mate 21.1, which is based (?) on Ubuntu 22.04 ("jammy"), rather than Debian, I expect that the same will apply for Debian;Tue Jun 13 04:33:23 bret@bret-Precision-Tower-5810:~$hwinfoand, in the output (lots of it - it outputs alot of details), is " P: /devices/virtual/dmi/id L: 0 E: DEVPATH=/devices/virtual/dmi/id E: SUBSYSTEM=dmi E: MODALIAS=dmi:bvnDellInc.:bvrA34:bd10/19/2020:br65.34:svnDellInc.:pnPrecisionTower5810:pvr:rvnDellInc.:rn0K240Y:rvrA02:cvnDellInc.:ct7:cvr:sku0617: E: USEC_INITIALIZED=2533353 E: ID_VENDOR=Dell Inc. E: ID_MODEL=Precision Tower 5810 E: MEMORY_ARRAY_LOCATION=System Board Or Motherboard E: MEMORY_ARRAY_EC_TYPE=Multi-bit ECC E: MEMORY_ARRAY_MAX_CAPACITY=137438953472<snip lots of et-cetera> I have to apologize; I completely misremembered the name of the program that I was referencing, probably because of the filenames I store its output under. hwinfo is absolutely not it. I would not consider output such as you presented to be appropriately readable for human consumption. Rather, I got the records I'm looking at from the program 'lshw'.
Okay - so the equivalent output that describes the memory, from lshw, is
"
*-memory
description: System Memory
physical id: 2f
slot: System board or motherboard
size: 128GiB
capabilities: ecc
configuration: errordetection=multi-bit-ecc
*-bank:0
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 0
serial: 400F4723
slot: DIMM1
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:1
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 1
serial: 39FDE464
slot: DIMM5
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:2
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 2
serial: 400F473D
slot: DIMM3
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:3
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 3
serial: 39FDD7B6
slot: DIMM7
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:4
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 4
serial: 400F4830
slot: DIMM2
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:5
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 5
serial: 39FDD7CA
slot: DIMM6
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:6
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 6
serial: 400F4722
slot: DIMM4
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
*-bank:7
description: RIMM DDR4 Synchronous 2133 MHz (0.5 ns)
product: M393A2G40DB0-CPB
vendor: Samsung
physical id: 7
serial: 39FDD7C9
slot: DIMM8
size: 16GiB
width: 64 bits
clock: 2133MHz (0.5ns)
"
which may appear to be more "human" understandable, for expressing the
capacity of each DIMM card in GiB, rather than in bytes, but, I had no
problem in finding and understanding the applicable output for
describing the RAM component of the hardware.
If being able to adequately interpret the output from hwinfo, makes me other than human, well, such is life.
Both utilities work, and, work sufficiently. hwinfo is simply less pretty than lshw. But, it nevertheless, works. .. Bret Busby Armadale West Australia (UTC+0800) ..............