Linux查看硬件信息的命令

Linux查看硬件信息的命令

 

1. lscpu

列出cpu信息

$ lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 60
Model name:            Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
Stepping:              3
CPU MHz:               3563.296
BogoMIPS:              7183.93
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K
NUMA node0 CPU(s):     0-7

 

2. lshw

lshw如果没有,使用下面的命令安装

$ sudo yum install -y lshw

如果是普通用户执行这个命令,

$ lshw -short
WARNING: you should run this program as super-user.
H/W path       Device  Class          Description
=================================================
                       system         Computer
/0                     bus            Motherboard
/0/0                   memory         7696MiB System memory
/0/1                   processor      Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
/0/100                 bridge         4th Gen Core Processor DRAM Controller
/0/100/1               bridge         Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller
/0/100/2               display        Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
/0/100/14              bus            8 Series/C220 Series Chipset Family USB xHCI
/0/100/16              communication  8 Series/C220 Series Chipset Family MEI Controller #1
/0/100/1a              bus            8 Series/C220 Series Chipset Family USB EHCI #2
/0/100/1b              multimedia     8 Series/C220 Series Chipset High Definition Audio Controller
/0/100/1c              bridge         8 Series/C220 Series Chipset Family PCI Express Root Port #1
/0/100/1c.2            bridge         8 Series/C220 Series Chipset Family PCI Express Root Port #3
/0/100/1c.2/0  enp3s0  network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/1d              bus            8 Series/C220 Series Chipset Family USB EHCI #1
/0/100/1f              bridge         C220 Series Chipset Family H81 Express LPC Controller
/0/100/1f.2            storage        8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]
/0/100/1f.3            bus            8 Series/C220 Series Chipset Family SMBus Controller
WARNING: output may be incomplete or inaccurate, you should run this program as super-user.


会给出warning,如果sudo

$ sudo lshw -short
[sudo] password for leo:
H/W path       Device  Class          Description
=================================================
                       system         All Series (All)
/0                     bus            H81M-K
/0/0                   memory         64KiB BIOS
/0/1                   memory         
/0/1/0                 memory         8GiB DIMM DDR3 Synchronous 1600 MHz (0.6 ns)
/0/38                  memory         System Memory
/0/38/0                memory         DIMM [empty]
/0/3c                  memory         256KiB L1 cache
/0/3d                  memory         1MiB L2 cache
/0/3e                  memory         8MiB L3 cache
/0/42                  processor      (Fill By OEM)
/0/2                   memory         
/0/3                   memory         
/0/100                 bridge         4th Gen Core Processor DRAM Controller
/0/100/1               bridge         Xeon E3-1200 v3/4th Gen Core Processor PCI Express x16 Controller
/0/100/2               display        Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller
/0/100/14              bus            8 Series/C220 Series Chipset Family USB xHCI
/0/100/14/0    usb4    bus            xHCI Host Controller
/0/100/14/1    usb3    bus            xHCI Host Controller
/0/100/14/1/2          multimedia     HD Pro Webcam C920
/0/100/14/1/3          input          Dell USB Entry Keyboard
/0/100/14/1/4          input          USB Optical Mouse
/0/100/16              communication  8 Series/C220 Series Chipset Family MEI Controller #1
/0/100/1a              bus            8 Series/C220 Series Chipset Family USB EHCI #2
/0/100/1a/1    usb1    bus            EHCI Host Controller
/0/100/1a/1/1          bus            USB hub
/0/100/1b              multimedia     8 Series/C220 Series Chipset High Definition Audio Controller
/0/100/1c              bridge         8 Series/C220 Series Chipset Family PCI Express Root Port #1
/0/100/1c.2            bridge         8 Series/C220 Series Chipset Family PCI Express Root Port #3
/0/100/1c.2/0  enp3s0  network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/1d              bus            8 Series/C220 Series Chipset Family USB EHCI #1
/0/100/1d/1    usb2    bus            EHCI Host Controller
/0/100/1d/1/1          bus            USB hub
/0/100/1f              bridge         C220 Series Chipset Family H81 Express LPC Controller
/0/100/1f.2            storage        8 Series/C220 Series Chipset Family 6-port SATA Controller 1 [AHCI mode]
/0/100/1f.3            bus            8 Series/C220 Series Chipset Family SMBus Controller
/1                     power          To Be Filled By O.E.M.

 

3. hwinfo

lshw如果没有,使用下面的命令安装

$ sudo yum install -y hwinfo

hwinfo –short
cpu:                                                            
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3747 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3850 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3905 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3892 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3808 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3736 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3796 MHz
                       Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz, 3689 MHz
keyboard:
  /dev/input/event3    Dell USB Entry Keyboard
mouse:
  /dev/input/mice      Lite-On USB Optical Mouse
graphics card:
                       Intel VGA compatible controller
sound:
                       Intel Audio device
storage:
                       Intel SATA controller
network:
  enp3s0               Realtek RTL8111/8168B PCI Express Gigabit Ethernet controller
network interface:
  lo                   Loopback network interface
  enp3s0               Ethernet network interface
disk:
  /dev/sda             WDC WD10EZEX-21M
partition:
  /dev/sda1            Partition
  /dev/sda2            Partition
  /dev/sda3            Partition
  /dev/sda4            Partition
  /dev/sda5            Partition
  /dev/sda6            Partition
usb controller:
                       Intel USB Controller
                       Intel USB Controller
                       Intel USB Controller
bios:
                       BIOS
bridge:
                       Intel Host bridge
                       Intel PCI bridge
                       Intel PCI bridge
                       Intel PCI bridge
                       Intel ISA bridge
hub:
                       Linux 3.10.0-229.el7.x86_64 xhci_hcd xHCI Host Controller
                       Linux 3.10.0-229.el7.x86_64 xhci_hcd xHCI Host Controller
                       Linux 3.10.0-229.el7.x86_64 ehci_hcd EHCI Host Controller
                       Hub
                       Linux 3.10.0-229.el7.x86_64 ehci_hcd EHCI Host Controller
                       Hub
memory:
                       Main Memory
unknown:
                       FPU
                       DMA controller
                       PIC
                       Timer
                       Keyboard controller
                       Intel Communication controller
                       Intel SMBus
  /dev/input/event6    Logitech HD Pro Webcam C920

 

4. lspci

列出所有的pci卡

比如列出显卡

$ lspci -v | grep "VGA" -A 12
00:02.0 VGA compatible controller: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06) (prog-if 00 [VGA controller])
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, fast devsel, latency 0, IRQ 44
    Memory at f7800000 (64-bit, non-prefetchable) [size=4M]
    Memory at e0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at f000 [size=64]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: i915

00:14.0 USB controller: Intel Corporation 8 Series/C220 Series Chipset Family USB xHCI (rev 05) (prog-if 30 [XHCI])
    Subsystem: ASUSTeK Computer Inc. Device 8534
    Flags: bus master, medium devsel, latency 0, IRQ 41

 

5. lsscsi

列出所有的scsi和sata设备

$ lsscsi
[1:0:0:0]    disk    ATA      WDC WD10EZEX-21M 01.0  /dev/sda

 

6. /proc

# cpu information
$ cat /proc/cpuinfo
# memory information
$ cat /proc/meminfo

 

7. lsusb

列出所有usb的设备

$ lsusb
Bus 001 Device 002: ID 8087:8008 Intel Corp.
Bus 002 Device 002: ID 8087:8000 Intel Corp.
Bus 003 Device 002: ID 046d:082d Logitech, Inc. HD Pro Webcam C920
Bus 003 Device 003: ID 413c:2107 Dell Computer Corp.
Bus 003 Device 004: ID 04ca:0061 Lite-On Technology Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

 

8. lsblk

列出所有分区

 

参考:

16 Commands to Check Hardware Information on Linux

 

版权所有,禁止转载. 如需转载,请先征得博主的同意,并且表明文章转载自:IT夜班车,否则按侵权处理.

    分享到:

One Reply to “Linux查看硬件信息的命令”

留言给教室网 取消

你的邮箱是保密的 必填的信息用*表示