Table of Contents
Listing Hardware Info in Linux #
Linux provides several command-line tools to inspect hardware details, including PCI devices, USB devices, and system BIOS/motherboard information. Below are the key commands:
1. lspci
– List PCI Devices #
Displays PCI (Peripheral Component Interconnect) devices (GPUs, network cards, storage controllers, etc.).
Basic Usage #
lspci
Example Output:
00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers (rev 08) 01:00.0 VGA compatible controller: NVIDIA Corporation GA106 [GeForce RTX 3060] (rev a1) 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Useful Options #
Command | Description |
---|---|
lspci -v | Detailed info (drivers, kernel modules) |
lspci -vv | Very verbose (IRQs, capabilities) |
lspci -k | Show kernel driver in use |
lspci -nn | Show vendor & device IDs (e.g., [10de:2504] for NVIDIA) |
2. lsusb
– List USB Devices #
Lists USB (Universal Serial Bus) devices (keyboards, mice, storage, etc.).
Basic Usage #
lsusb
Example Output:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub Bus 001 Device 004: ID 046d:c08b Logitech, Inc. G502 SE HERO Gaming Mouse Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Useful Options #
Command | Description |
---|---|
lsusb -v | Detailed USB device info |
lsusb -t | Show USB device tree |
lsusb -s 001:003 | Show specific device (Bus 001, Device 003) |
3. dmidecode
– DMI (SMBIOS) Hardware Info #
Extracts BIOS, motherboard, RAM, CPU, and chassis details from the DMI (Desktop Management Interface) table.
Basic Usage (Requires sudo
) #
sudo dmidecode
Example Output (Partial):
Handle 0x0002, DMI type 2, 15 bytes Base Board Information Manufacturer: ASUSTeK COMPUTER INC. Product Name: ROG STRIX B550-F GAMING Version: Rev X.0x
Filtering Specific Info #
Command | Description |
---|---|
sudo dmidecode -t bios | BIOS information |
sudo dmidecode -t system | System (manufacturer, model) |
sudo dmidecode -t baseboard | Motherboard details |
sudo dmidecode -t memory | RAM slots & details |
sudo dmidecode -t processor | CPU information |
Comparison of Tools #
Tool | Purpose | Requires sudo ? |
---|---|---|
lspci | PCI devices (GPU, NIC, SATA) | No |
lsusb | USB devices (keyboard, flash drives) | No |
dmidecode | BIOS, motherboard, RAM, CPU | Yes |
Additional Hardware Info Commands #
Command | Description |
---|---|
lscpu | CPU architecture & cores |
lsblk | Block devices (disks, partitions) |
hwinfo --short | Comprehensive hardware summary |
inxi -Fxz | Full system overview (requires inxi package) |
Example Workflow #
- Check GPU & Network Card:bashlspci | grep -E “VGA|Ethernet”
- List All USB Devices:bashlsusb -v
- Get RAM & Motherboard Info:bashsudo dmidecode -t memory sudo dmidecode -t baseboard
Conclusion #
lspci
→ PCI devices (GPU, NIC, storage controllers).lsusb
→ USB devices (keyboard, mouse, flash drives).dmidecode
→ BIOS, motherboard, RAM, CPU (requiressudo
).