I’ve tried to gather here the commands I use to check hardware information on the Linux systems I administer. I included instructions on how to get data on CPU, memory, disks, USB controllers, network adapters, and other components.
lscpu
The lscpu command reports information about the CPU and processing units. It has no additional options or functionalities.
$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Thread(s) per core: 1
Core(s) per socket: 4
Socket(s): 1
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 23
Stepping: 10
CPU MHz: 1998.000
BogoMIPS: 5302.48
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 2048K
NUMA node0 CPU(s): 0-3
lshw – List Hardware
lshw is a general-purpose tool that reports detailed information about multiple hardware components, such as CPU, memory, disks, USB controllers, network adapters, etc. It extracts information from different files in /proc.
$ lshw -short
H/W path Device Class Description
===================================================
system ()
/0 bus DG35EC
/0/0 processor Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz
/0/0/1 memory 2MiB L2 cache
/0/0/3 memory 32KiB L1 cache
/0/2 memory 32KiB L1 cache
/0/4 memory 64KiB BIOS
/0/14 memory 8GiB System Memory
/0/14/0 memory 2GiB DIMM DDR2 Synchronous 667 MHz (1.5 ns)
/0/14/1 memory 2GiB DIMM DDR2 Synchronous 667 MHz (1.5 ns)
/0/14/2 memory 2GiB DIMM DDR2 Synchronous 667 MHz (1.5 ns)
/0/14/3 memory 2GiB DIMM DDR2 Synchronous 667 MHz (1.5 ns)
/0/100 bridge 82G35 Express DRAM Controller
/0/100/2 display 82G35 Express Integrated Graphics Controller
/0/100/2.1 display 82G35 Express Integrated Graphics Controller
/0/100/19 eth0 network 82566DC Gigabit Network Connection
hwinfo – Hardware Information
hwinfo is a hardware detection tool that can report detailed information about various hardware components.
$ hwinfo --short
cpu:
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz, 2000 MHz
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz, 2000 MHz
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz, 2666 MHz
Intel(R) Core(TM)2 Quad CPU Q8400 @ 2.66GHz, 2666 MHz
keyboard:
/dev/input/event2 AT Translated Set 2 keyboard
mouse:
/dev/input/mice Microsoft Basic Optical Mouse v2.0
graphics card:
Intel 965G-1 Intel 82G35 Express Integrated Graphics Controller
sound:
Intel 82801H (ICH8 Family) HD Audio Controller
lspci – List PCI
The lspci command lists all PCI buses and details about the devices connected to them.
$ lspci
00:00.0 Host bridge: Intel Corporation 82G35 Express DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation 82G35 Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation 82G35 Express Integrated Graphics Controller (rev 03)
00:19.0 Ethernet controller: Intel Corporation 82566DC Gigabit Network Connection (rev 02)
lsscsi – List SCSI Devices
lsscsi lists SCSI/SATA devices such as hard drives and optical drives.
$ lsscsi
[3:0:0:0] disk ATA ST3500418AS CC38 /dev/sda
[4:0:0:0] cd/dvd SONY DVD RW DRU-190A 1.63 /dev/sr0
lsusb – List USB Devices
The lsusb command shows USB controllers and details about the devices connected to them. Use the -v (verbose) option for detailed information.
$ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 045e:00cb Microsoft Corp. Basic Optical Mouse v2.0
lsblk – List Block Devices
lsblk lists information about all block devices, such as hard disk partitions and other storage devices.
$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 70G 0 part
├─sda2 8:2 0 1K 0 part
├─sda5 8:5 0 97.7G 0 part /media/4668484A68483B47
├─sda6 8:6 0 97.7G 0 part /
├─sda7 8:7 0 1.9G 0 part [SWAP]
└─sda8 8:8 0 198.5G 0 part /media/13f35f59-f023-4d98-b06f-9dfaebefd6c1
sr0 11:0 1 1024M 0 rom
Inxi
inxi is a bash script that collects hardware details from various sources and commands on the system, producing a comprehensive report.
$ inxi -Fx
System:
Host: fedora Kernel: 6.9.8-200.fc40.x86_64 arch: x86_64 bits: 64
compiler: gcc v: 2.41-37.fc40
Desktop: KDE Plasma v: 6.1.3 Distro: Fedora Linux 40 (KDE Plasma)
Machine:
Type: Laptop System: Dell product: Inspiron 7560 v: N/A
serial: <superuser required>
Mobo: Dell model: 09WC1G v: A01 serial: <superuser required> UEFI: Dell
v: 1.15.0 date: 07/23/2021
Battery:
ID-1: BAT0 charge: 5.7 Wh (100.0%) condition: 5.7/42.0 Wh (13.7%)
volts: 12.4 min: 11.4 model: SMP DELL Y3F7Y6B status: full
Device-1: wacom_battery_0 model: Wacom Intuos S 2 charge: 100%
status: full
CPU:
Info: dual core model: Intel Core i7-7500U bits: 64 type: MT MCP
arch: Amber/Kaby Lake note: check rev: 9 cache: L1: 128 KiB L2: 512 KiB
L3: 4 MiB
Speed (MHz): avg: 800 high: 801 min/max: 400/3500 cores: 1: 801 2: 800
3: 800 4: 800 bogomips: 23199
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
Device-1: Intel HD Graphics 620 vendor: Dell driver: i915 v: kernel
arch: Gen-9.5 bus-ID: 00:02.0
Device-2: NVIDIA GM108M [GeForce 940MX] vendor: Dell driver: nouveau
v: kernel arch: Maxwell bus-ID: 01:00.0
Device-3: Microdia Integrated_Webcam_HD driver: uvcvideo type: USB
bus-ID: 1-5:4
Display: wayland server: Xwayland v: 24.1.1 compositor: kwin_wayland
driver: N/A resolution: 1920x1080
API: EGL v: 1.5 drivers: iris,nouveau,swrast platforms:
active: wayland,x11,surfaceless,device inactive: gbm
API: OpenGL v: 4.6 compat-v: 4.3 vendor: intel mesa v: 24.1.4 glx-v: 1.4
direct-render: yes renderer: Mesa Intel HD Graphics 620 (KBL GT2)
API: Vulkan v: 1.3.283 drivers: N/A surfaces: xcb,xlib,wayland devices: 2
Audio:
Device-1: Intel Sunrise Point-LP HD Audio vendor: Dell driver: snd_hda_intel
v: kernel bus-ID: 00:1f.3
API: ALSA v: k6.9.8-200.fc40.x86_64 status: kernel-api
Server-1: PipeWire v: 1.0.7 status: active
Network:
Device-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter
vendor: Dell driver: ath10k_pci v: kernel bus-ID: 02:00.0 temp: 36.0 C
IF: wlp2s0 state: up mac: 12:49:3c:d5:b5:cf
Device-2: Realtek RTL8111/8168/8211/8411 PCI Express Gigabit Ethernet
vendor: Dell driver: r8169 v: kernel port: d000 bus-ID: 03:00.0
IF: enp3s0 state: down mac: 84:7b:eb:f9:87:69
Bluetooth:
Device-1: Qualcomm Atheros driver: btusb v: 0.8 type: USB bus-ID: 1-8:6
Report: btmgmt ID: hci0 rfk-id: 0 state: up address: A8:6B:AD:DE:14:AA
bt-v: 4.2 lmp-v: 8
Drives:
Local Storage: total: 231.03 GiB used: 27.75 GiB (12.0%)
ID-1: /dev/sda vendor: Gigabyte model: GP-GSTFS31120GNTD size: 111.79 GiB
ID-2: /dev/sdb vendor: LITE-ON model: L8H-128V2G-11 M.2 2280 128GB
size: 119.24 GiB
Partition:
ID-1: / size: 37.25 GiB used: 27.25 GiB (73.2%) fs: btrfs dev: /dev/sda4
ID-2: /boot size: 965.9 MiB used: 466.6 MiB (48.3%) fs: ext4
dev: /dev/sda3
ID-3: /boot/efi size: 598.8 MiB used: 44.9 MiB (7.5%) fs: vfat
dev: /dev/sda2
Swap:
ID-1: swap-1 type: zram size: 8 GiB used: 33.2 MiB (0.4%) dev: /dev/zram0
Sensors:
System Temperatures: cpu: 56.0 C pch: 47.5 C mobo: 45.0 C sodimm: SODIMM C
Fan Speeds (rpm): cpu: 2539
Info:
Memory: total: 16 GiB available: 15.51 GiB used: 8.06 GiB (52.0%)
Processes: 274 Uptime: 22h 5m Init: systemd target: graphical (5)
Packages: 15 Compilers: gcc: 14.1.1 Shell: Bash v: 5.2.26 inxi: 3.3.34
muller@fedora:~$
df – Disk Space
The df command reports various partitions, their mount points, and the used and available space on each.
$ df -H
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 104G 26G 73G 26% /
none 4.1k 0 4.1k 0% /sys/fs/cgroup
udev 4.2G 4.1k 4.2G 1% /dev
tmpfs 837M 1.6M 835M 1% /run
Pydf – df in Python
pydf is an enhanced version of df written in Python, which displays colored output.
To install:
$ pip install pydf
To use:
$ pydf
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 96G 23G 68G 24.4 [#.....] /
/dev/sda8 195G 138G 47G 70.6 [####..] /media/13f35f59-f023-4d98-b06f-9dfaebefd6c
fdisk
fdisk is a tool for modifying partitions on hard disks and can also be used to list partition information.
$ fdisk -l
Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x30093008
Device Boot Start End Blocks Id System
/dev/sda1 * 63 146801969 73400953+ 7 HPFS/NTFS/exFAT
/dev/sda2 146802031 976771071 414984520+ f W95 Ext'd (LBA)
/dev/sda5 146802033 351614654 102406311 7 HPFS/NTFS/exFAT
/dev/sda6 351614718 556427339 102406311 83 Linux
/dev/sda7 556429312 560427007 1998848 82 Linux swap / Solaris
/dev/sda8 560429056 976771071 208171008 83 Linux
mount
The mount command is used to mount/unmount and to view mounted filesystems.
$ mount | column -t
/dev/sda6 on / type ext4 (rw,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
sysfs on /sys type sysfs (rw,noexec,nosuid,nodev)
udev on /dev type devtmpfs (rw,mode=0755)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=0620)
tmpfs on /run type tmpfs (rw,noexec,nosuid,size=10%,mode=0755)
free – Check RAM
Check the amount of used, free, and total RAM on the system with the free command.
$ free -m
total used free shared buffers cached
Mem: 7975 5865 2110 0 24 622
-/+ buffers/cache: 5218 2757
Swap: 1951 921 1030
dmidecode
The dmidecode command extracts hardware information by reading data from SMBIOS structures (also called DMI tables).
# Processor/CPU information
$ dmidecode -t processor
# Memory/RAM information
$ dmidecode -t memory
# BIOS details
$ dmidecode -t bios
/proc Files
Many virtual files in the /proc directory contain information about hardware and settings.
# CPU information
$ cat /proc/cpuinfo
# Memory information
$ cat /proc/meminfo
# Linux/kernel information
$ cat /proc/version
# SCSI/SATA devices
$ cat /proc/scsi/scsi
# Partitions
$ cat /proc/partitions
hdparm
The hdparm command gets information about SATA devices such as hard drives.
$ hdparm -i /dev/sda
/dev/sda:
Model=ST3500418AS, FwRev=CC38, SerialNo=
Config={ HardSect NotMFM HdSw>15uSec Fixed DTR>10Mbs RotSpdTol>.5% }
RawCHS=16383/16/63, TrkSize=0, SectSize=0, ECCbytes=4
BuffType=unknown, BuffSize=16384kB, MaxMultSect=16, MultSect=16
CurCHS=16383/16/63, CurSects=16514064, LBA=yes, LBAsects=976773168
IORDY=on/off, tPIO={min:120,w/IORDY:120}, tDMA={min:120,rec:120}
PIO modes: pio0 pio1 pio2 pio3 pio4
DMA modes: mdma0 mdma1 mdma2
UDMA modes: udma0 udma1 udma2 udma3 udma4 udma5 *udma6
AdvancedPM=no WriteCache=enabled
Drive conforms to: unknown: ATA/ATAPI-4,5,6,7
Disclaimer
The logic adopted for this manual was based on needs throughout my career — troubleshooting application problems that turned out to have hardware-related root causes, or issues I faced while assembling and disassembling laptops and computers.