Linux 查看系統及硬體資訊

在 Linux 下查看系統及硬體資訊十分實用, 可以在安裝新套件或驅動程式時找出相容性問題, 以下會介紹在 Linux 下查看系統及硬體資訊的方法。

1. 透過 uname 查看系統資訊:

找行 "uname" 會顯示系統名稱:

$ uname

查看 kernel 版本:

$ uname -r


$ uname -m


$ uname -a
Linux localhost 3.10.0-229.14.1.el7.x86_64 #1 SMP Tue Sep 15 15:05:51 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

2. 查看硬體資訊

lshw 是一個透過讀取 /proc 裡面的檔案, 擷取硬體資訊的工具, 執行 lshw 需要有 root 權限。

安裝 lshw:

# yum install lshw

要顯示所有硬體資訊, 直接執行 lshw:

# lshw

上面的指令會顯示所有資訊, 十分詳盡, 如果只想顯示硬體的概要資訊, 可以加上 -short 參數:

# lshw -short

3. 顯示 CPU 資訊
系統內的 CPU 資訊可以在 /proc/cpuinfo 檔案查看, 而 lscpu 會透過 /proc/cpuinfo 顯示 CPU 的數量, 核心數量, CPU 類型等資訊:

# lscpu

4. 查看 Linux Block Device 資訊:

# lsblk

5. 查看 USB Controllers 資訊

# lsusb

6. 查看 PCI 裝置資訊

# lspci

7. 查看 SCSI 裝置資訊

安裝 lsscsi:

# yum install lsscsi


# dnf install lsscsi

Debian, Ubuntu:

# apt-get install lsscsi

執行 lsscsi:

# lsscsi

8. 擷取硬體元件

可以透過 dmidecode 擷取硬體的元件資訊, 例如擷取記憶體的資訊:

# dmidecode -t memory


# dmidecode -t system
# dmidecode 2.12
SMBIOS 2.5 present.

Handle 0x0002, DMI type 1, 27 bytes
System Information
Manufacturer: Dell
Product Name: CS24-TY
Version: A00
Serial Number: 2RBSMH1
UUID: 44454C4C-5200-1042-8053-B2C04F4D4831
Wake-up Type: Power Switch
SKU Number: To Be Filled By O.E.M.
Family: Server

Handle 0x0048, DMI type 32, 20 bytes
System Boot Information
Status: No errors detected

擷取 BIOS 資訊:

# dmidecode -t bios
# dmidecode 2.12
SMBIOS 2.5 present.

Handle 0x0001, DMI type 0, 24 bytes
BIOS Information
Vendor: Dell Computer Corporation
Version: S99C3B22
Release Date: 08/30/2011
Address: 0xF0000
Runtime Size: 64 kB
ROM Size: 4096 kB
ISA is supported
PCI is supported
PNP is supported
BIOS is upgradeable
BIOS shadowing is allowed
ESCD support is available
Boot from CD is supported
Selectable boot is supported
Print screen service is supported (int 5h)
Serial services are supported (int 14h)
Printer services are supported (int 17h)
CGA/mono video services are supported (int 10h)
ACPI is supported
USB legacy is supported
LS-120 boot is supported
ATAPI Zip drive boot is supported
BIOS boot specification is supported
Function key-initiated network boot is supported
Targeted content distribution is supported
BIOS Revision: 8.16

Handle 0x0033, DMI type 13, 22 bytes
BIOS Language Information
Language Description Format: Long
Installable Languages: 1
Currently Installed Language: en|US|iso8859-1

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.