Gaining information about your Linux system using the Linux command line.

Gaining information about a Linux system is very easy, there are quite a few Linux commands that can print detailed specs of your hardware configuration.

The lsblk command prints information about your block devices. This can be used to list all disk partitions and CD/DVD drives.

┌─[jason@neo][~]
└──╼ $lsblk 
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 465.8G  0 disk 
├─sda1   8:1    0   454G  0 part /
├─sda2   8:2    0     1K  0 part 
└─sda5   8:5    0  11.8G  0 part [SWAP]
sdb      8:16   1    15G  0 disk 
└─sdb1   8:17   1    15G  0 part /media/jason/707B-A3DF
sr0     11:0    1   3.7G  0 rom  /media/cdrom0

Use the lsusb command to print a list of all USB devices on your machine. In my Debian laptop, this prints information about the integrated WIFI adapter and the card reader.

┌─[][jason@neo][~]
└──╼ $lsusb 
Bus 004 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 004 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 005: ID 0bda:58c2 Realtek Semiconductor Corp. 
Bus 003 Device 004: ID 0bda:0129 Realtek Semiconductor Corp. RTS5129 Card Reader Controller
Bus 003 Device 003: ID 0cf3:e004 Atheros Communications, Inc. 
Bus 003 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 13fe:5500 Kingston Technology Company Inc. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

The lspci command will also print hardware information. This lists all installed hardware.

┌─[jason@neo][~]
└──╼ $lspci
00:00.0 Host bridge: Intel Corporation 3rd Gen Core processor DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor Graphics Controller (rev 09)
00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB xHCI Host Controller (rev 04)
00:16.0 Communication controller: Intel Corporation 7 Series/C210 Series Chipset Family MEI Controller #1 (rev 04)
00:1a.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #2 (rev 04)
00:1b.0 Audio device: Intel Corporation 7 Series/C210 Series Chipset Family High Definition Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 1 (rev c4)
00:1c.1 PCI bridge: Intel Corporation 7 Series/C210 Series Chipset Family PCI Express Root Port 2 (rev c4)
00:1d.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset Family USB Enhanced Host Controller #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation HM76 Express Chipset LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 7 Series Chipset Family 6-port SATA Controller [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 7 Series/C210 Series Chipset Family SMBus Controller (rev 04)
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8101E/RTL8102E PCI Express Fast Ethernet controller (rev 05)
02:00.0 Network controller: Qualcomm Atheros AR9485 Wireless Network Adapter (rev 01)

To get information about the installed CPU, use the lscpu command.

┌─[][jason@neo][~]
└──╼ $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:    2
Core(s) per socket:    2
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 58
Model name:            Intel(R) Core(TM) i5-3337U CPU @ 1.80GHz
Stepping:              9
CPU MHz:               1504.476
CPU max MHz:           2700.0000
CPU min MHz:           800.0000
BogoMIPS:              3591.53
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              3072K
NUMA node0 CPU(s):     0-3

This prints information about the CPU including Virtualization and the clock speed.

The lshw command will allow you to get information about the installed graphics adapter. Firstly, install the utility if needed.

[email protected]:/home/jason# apt install lshw

Then run this command to get graphics adapter information.

root@neo:/home/jason# lshw -short | grep -i --color display
/0/100/2                           display        3rd Gen Core processor Graphics Controller

If you wish to get more detailed processor information, run this command as root.

[email protected]:/home/jason# dmidecode -t processor

Here is another example, getting system information.

root@neo:/home/jason# dmidecode -t system
# dmidecode 2.12
SMBIOS 2.7 present.
 
Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: Dell Inc.
	Product Name: Inspiron 3521
	Version: A05
	Serial Number: HSD5DW1
	UUID: 4C4C4544-0053-4410-8035-C8C04F445731
	Wake-up Type: Power Switch
	SKU Number: xxx123x#ABA
	Family: 103C_5335KV
 
Handle 0x0021, DMI type 12, 5 bytes
System Configuration Options
	Option 1: String1 for Type12 Equipment Manufacturer
	Option 2: String2 for Type12 Equipment Manufacturer
	Option 3: String3 for Type12 Equipment Manufacturer
	Option 4: String4 for Type12 Equipment Manufacturer
 
Handle 0x0032, DMI type 32, 20 bytes
System Boot Information
	Status: No errors detected

Run the command man dmidecode to get more information on the keywords to use when gaining system info with this useful utility.

Or run it like this.

jason$ sudo dmidecode -t 
dmidecode: option requires an argument -- 't'
Type number or keyword expected
Valid type keywords are:
  bios
  system
  baseboard
  chassis
  processor
  memory
  cache
  connector
  slot
The dmidecode utility printing chassis info.
The dmidecode utility printing chassis info.

This is the best way to get information about the motherboard.

root@neo:/home/jason# dmidecode -t baseboard
# dmidecode 2.12
SMBIOS 2.7 present.
 
Handle 0x0002, DMI type 2, 16 bytes
Base Board Information
	Manufacturer: Dell Inc.
	Product Name: 0010T1
	Version: A00
	Serial Number: .HSD5DW1.CN1296633M0063.
	Asset Tag: Not Specified
	Features:
		Board is a hosting board
		Board is replaceable
	Location In Chassis: Type2 - Board Chassis Location
	Chassis Handle: 0x0003
	Type: Motherboard
	Contained Object Handles: 0
 
Handle 0x001F, DMI type 10, 6 bytes
On Board Device Information
	Type: Video
	Status: Enabled
	Description: Intel Video Graphics Controller
 
Handle 0x0035, DMI type 41, 11 bytes
Onboard Device
	Reference Designation: Hanksville Gbe Lan Connection
	Type: Ethernet
	Status: Enabled
	Type Instance: 1
	Bus Address: 0000:00:00.1

Give these useful commands a go and get a good picture of the installed hardware in your machine today.

If the Linux user has an NVidia card and the proprietary drivers installed, the nvidia-smi command will return detailed graphics card information. This does not require sudo or a root prompt.

jason$ nvidia-smi
Tue Nov  1 13:39:51 2016       
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 367.44                 Driver Version: 367.44                    |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  GeForce GT 740      Off  | 0000:04:00.0     N/A |                  N/A |
| 50%   29C    P0    N/A /  N/A |     92MiB /  1996MiB |     N/A      Default |
+-------------------------------+----------------------+----------------------+
 
+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
|  GPU       PID  Type  Process name                               Usage      |
|=============================================================================|
|    0                  Not Supported                                         |
+-----------------------------------------------------------------------------+

No comments have been made. Use this form to start the conversation :)

Leave a Reply