Digital Sanctum

Personal blog of Shane Witbeck Tags · Archive · About

How to Get Hardware Details from Command Line on Ubuntu

Published: 26 Oct 2021

CPU

cat /proc/cpuinfo | grep 'model name\|cpu family\|processor\|cache size' | sort -u

Here’s an example of the output:

cache size	: 12288 KB
cpu cores	: 6
cpu family	: 6
model name	: Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
processor	: 0
processor	: 1
processor	: 10
processor	: 11
processor	: 2
processor	: 3
processor	: 4
processor	: 5
processor	: 6
processor	: 7
processor	: 8
processor	: 9

Disk

hwinfo --disk | grep 'Device Files'

Note: You may have to install hwinfo

Here’s an example of the output (in this case I have two disks):

  Device Files: /dev/nvme0n1, /dev/disk/by-id/nvme-Samsung_SSD_970_PRO_1TB_S462NF0M621968K, /dev/disk/by-path/pci-0000:04:00.0-nvme-1, /dev/disk/by-id/nvme-eui.0025385691b57092
  Device Files: /dev/sda, /dev/disk/by-label/disk1, /dev/disk/by-id/wwn-0x5002538e40529604, /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3Z8NB0K702696L, /dev/disk/by-uuid/67864506-3ff3-4bc0-bd88-3cdacee5ca46, /dev/disk/by-path/pci-0000:00:17.0-ata-1

Display

sudo lshw -c display | grep 'product\|vendor'

Example output:

  product: GP106 [GeForce GTX 1060 6GB]
   vendor: NVIDIA Corporation

Memory

sudo dmidecode --type 17 | grep -e 'Speed\|Type:\|Size' | sort -u

Example output:

Configured Memory Speed: 2133 MT/s
                   Size: 16384 MB
                  Speed: 2133 MT/s
                   Type: DDR4
Tags: #how-to#ubuntu#hardware