成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

9個Linux 常用查看系統硬件信息命令(實例詳解)

系統 Linux
在Linux下,我們經常需要查看系統的硬件信息, 這里我羅列了查看系統硬件信息的實用命令,并做了分類,實例解說。

[[392110]]

在Linux下,我們經常需要查看系統的硬件信息, 這里我羅列了查看系統硬件信息的實用命令,并做了分類,實例解說。

執行環境:ubuntu 16.04

1. cpu

lscpu命令,查看的是cpu的統計信息.

  1. root@ubuntu:/home/peng/# lscpu 
  2. Architecture:          x86_64            #cpu架構 
  3. CPU op-mode(s):        32-bit, 64-bit 
  4. Byte Order:            Little Endian     #小尾序 
  5. CPU(s):                1                 #總共有1核    
  6. On-line CPU(s) list:   0 
  7. Thread(s) per core:    1                 #每個cpu核,只能支持一個線程,即不支持超線程  
  8. Core(s) per socket:    1 
  9. Socket(s):             1 
  10. NUMA node(s):          1 
  11. Vendor ID:             GenuineIntel     #cpu產商 intel 
  12. CPU family:            6 
  13. Model:                 158 
  14. Model name:            Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz 
  15. Stepping:              9 
  16. CPU MHz:               3408.070 
  17. BogoMIPS:              6816.14 
  18. Hypervisor vendor:     VMware 
  19. Virtualization type:   full             #支持cpu虛擬化技術 
  20. L1d cache:             32K 
  21. L1i cache:             32K 
  22. L2 cache:              256K 
  23. L3 cache:              6144K 
  24. NUMA node0 CPU(s):     0 

查看/proc/cpuinfo,可以知道每個cpu信息,如每個CPU的型號,主頻等。

  1. root@ubuntu:/home/peng# cat /proc/cpuinfo 
  2. processor : 0 
  3. vendor_id : GenuineIntel 
  4. cpu family : 6 
  5. model  : 158 
  6. model name : Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz 
  7. stepping : 9 
  8. microcode : 0x48 
  9. cpu MHz  : 3408.070 
  10. cache size : 6144 KB 
  11. physical id : 0 
  12. siblings : 1 
  13. core id  : 0 
  14. cpu cores : 1 
  15. apicid  : 0 
  16. initial apicid : 0 
  17. fpu  : yes 
  18. fpu_exception : yes 
  19. cpuid level : 22 
  20. wp  : yes 
  21. ..... 

2. 內存

概要查看內存情況

  1. root@ubuntu:/home/peng# free -m 
  2.               total        used        free      shared  buff/cache   available 
  3. Mem:           1970         702         315          13         952        1025 
  4. Swap:           974          20         954 

這里的單位是MB,總共的內存是1970MB。

查看內存詳細使用

  1. root@ubuntu:/home/peng# cat /proc/meminfo  
  2. MemTotal:        2017516 kB 
  3. MemFree:          242020 kB 
  4. MemAvailable:    1003240 kB 
  5. Buffers:          104192 kB 
  6. Cached:           699824 kB 
  7. SwapCached:         1832 kB 
  8. Active:           696320 kB 
  9. Inactive:         639924 kB 
  10. Active(anon):     236412 kB 
  11. Inactive(anon):   301996 kB 
  12. Active(file):     459908 kB 
  13. Inactive(file):   337928 kB 
  14. Unevictable:          48 kB 
  15. Mlocked:              48 kB 
  16. ..... 

查看內存硬件信息

  1. root@ubuntu:/home/peng# dmidecode -t memory 
  2. # dmidecode 3.0                                                                                                                                                                                  
  3. Getting SMBIOS data from sysfs. 
  4. SMBIOS 2.7 present. 
  5.   
  6. Handle 0x0084, DMI type 5, 46 bytes 
  7. Memory Controller Information 
  8.     Error Detecting Method: None 
  9.     Error Correcting Capabilities: 
  10.          None 
  11.     Supported Interleave: One-way Interleave 
  12.     Current Interleave: One-way Interleave 
  13.     Maximum Memory Module Size: 32768 MB 
  14.     Maximum Total Memory Size: 491520 MB 
  15.     Supported Speeds: 
  16.         70 ns 
  17.         60 ns 
  18.     Supported Memory Types: 
  19.         FPM 
  20.         EDO 
  21.         DIMM 
  22.         SDRAM 
  23.     Memory Module Voltage: 3.3 V 
  24.     Associated Memory Slots: 15 
  25. ..... 

內存最大值是 491520 MB。

3. 磁盤

查看硬盤和分區分布

  1. root@ubuntu:/home/peng# lsblk 
  2. NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT 
  3. sr0     11:0    1 1024M  0 rom   
  4. sda      8:0    0  500G  0 disk  
  5. ├─sda2   8:2    0    1K  0 part  
  6. ├─sda5   8:5    0  975M  0 part [SWAP] 
  7. └─sda1   8:1    0  499G  0 part / 

查看硬盤和分區的詳細信息

  1. root@ubuntu:/home/peng# fdisk -l 
  2. Disk /dev/sda: 500 GiB, 536870912000 bytes, 1048576000 sectors 
  3. Units: sectors of 1 * 512 = 512 bytes 
  4. Sector size (logical/physical): 512 bytes / 512 bytes 
  5. I/O size (minimum/optimal): 512 bytes / 512 bytes 
  6. Disklabel type: dos 
  7. Disk identifier: 0x9c674a44 
  8.  
  9. Device     Boot      Start        End    Sectors  Size Id Type 
  10. /dev/sda1  *          2048 1046575103 1046573056  499G 83 Linux 
  11. /dev/sda2       1046577150 1048573951    1996802  975M  5 Extended 
  12. /dev/sda5       1046577152 1048573951    1996800  975M 82 Linux swap / Solaris 

4. 網卡

查看網卡硬件信息

  1. root@ubuntu:/home/peng# lspci | grep -i 'eth' 
  2. 02:01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01) 

查看系統的所有網絡接口

  1. root@ubuntu:/home/peng# ifconfig -a 
  2. ens33     Link encap:Ethernet  HWaddr 00:0c:29:bb:bd:40   
  3.           inet addr:192.168.0.117  Bcast:192.168.0.255  Mask:255.255.255.0 
  4.           inet6 addr: fe80::76fa:5548:3da0:2ef/64 Scope:Link 
  5.           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
  6.           RX packets:174629 errors:0 dropped:0 overruns:0 frame:0 
  7.           TX packets:105285 errors:0 dropped:0 overruns:0 carrier:0 
  8.           collisions:0 txqueuelen:1000  
  9.           RX bytes:237519396 (237.5 MB)  TX bytes:9592767 (9.5 MB) 
  10.  
  11. lo        Link encap:Local Loopback   
  12.           inet addr:127.0.0.1  Mask:255.0.0.0 
  13.           inet6 addr: ::1/128 Scope:Host 
  14.           UP LOOPBACK RUNNING  MTU:65536  Metric:1 
  15.           RX packets:854 errors:0 dropped:0 overruns:0 frame:0 
  16.           TX packets:854 errors:0 dropped:0 overruns:0 carrier:0 
  17.           collisions:0 txqueuelen:1000  
  18.           RX bytes:60894 (60.8 KB)  TX bytes:60894 (60.8 KB) 

或者是

  1. root@ubuntu:/home/peng# ip link show 
  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 
  3.     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 
  4. 2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 
  5.     link/ether 00:0c:29:bb:bd:40 brd ff:ff:ff:ff:ff:ff 

或者

如果要查看某個網絡接口的詳細信息,例如ens33的詳細參數和指標

【有的ubuntu網口是eth0】

  1. root@ubuntu:/home/peng# ethtool ens33 
  2. Settings for ens33: 
  3.  Supported ports: [ TP ] 
  4.  Supported link modes:   10baseT/Half 10baseT/Full  
  5.                          100baseT/Half 100baseT/Full #支持千兆半雙工,全雙工模式 
  6.                          1000baseT/Full  
  7.  Supported pause frame use: No 
  8.  Supports auto-negotiation: Yes #默認使用自適應模式 
  9.  Advertised link modes:  10baseT/Half 10baseT/Full  
  10.                          100baseT/Half 100baseT/Full  
  11.                          1000baseT/Full  
  12.  Advertised pause frame use: No 
  13.  Advertised auto-negotiation: Yes 
  14.  Speed: 1000Mb/s #網卡的速度是1000Mb 
  15.  Duplex: Full    #全雙工 
  16.  Port: Twisted Pair 
  17.  PHYAD: 0 
  18.  Transceiver: internal 
  19.  Auto-negotiation: on 
  20.  MDI-X: off (auto) 
  21.  Supports Wake-on: d 
  22.  Wake-on: d 
  23.  Current message level: 0x00000007 (7) 
  24.           drv probe link 
  25.  Link detected: yes   #表示有網線連接,和路由是通的 

5. pci

查看pci信息,即主板所有硬件槽信息。

  1. root@ubuntu:/home/peng# lspci 
  2.  00:00.0 Host bridge: Intel Corporation 82845 845 (Brookdale) Chipset Host Bridge (rev 04) 
  3.  00:01.0 PCI bridge: Intel Corporation 82845 845 (Brookdale) Chipset AGP Bridge(rev 04) 
  4.  00:1d.0 USB Controller: Intel Corporation 82801CA/CAM USB (Hub #1) (rev 02) 
  5.  00:1d.1 USB Controller: Intel Corporation 82801CA/CAM USB (Hub #2) (rev 02) 
  6.  00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 42) 
  7.  00:1f.0 ISA bridge: Intel Corporation 82801CAM ISA Bridge (LPC) (rev 02) 
  8.  00:1f.1 IDE interface: Intel Corporation 82801CAM IDE U100 (rev 02) 
  9.  00:1f.3 SMBus: Intel Corporation 82801CA/CAM SMBus Controller (rev 02) 
  10.  00:1f.5 Multimedia audio controller:Intel Corporation 82801CA/CAM AC'97 Audio Controller (rev 02) 
  11.  00:1f.6 Modem: Intel Corporation 82801CA/CAM AC'97 Modem Controller (rev 02) 
  12.  01:00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 420 Go](rev a3) 
  13.  02:00.0 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller(rev 46) 
  14.  02:01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+(rev 10) 
  15.  02:04.0 CardBus bridge: O2 Micro, Inc. OZ6933 Cardbus Controller (rev 01) 
  16.  02:04.1 CardBus bridge: O2 Micro, Inc. OZ6933 Cardbus Controller (rev 01) 

由上述的 輸出可以看到,我的電腦上共有3個PCI總線(0號,1號,2號)。在單個系統上,插入多個總線是通過橋(bridge)來完成的,橋是一種用來連接總線 的特殊PCI外設。所以,PCI系統的整體布局組織為樹型,我們可以通過上面的lspci輸出,來畫出我的電腦上的PCI系統的樹型結構:

  1. 00:00.0(主橋)--00:01.0(PCI橋)-----01:00:0(nVidia顯卡) 
  2.                    | 
  3.                    |---00:1d(USB控制器)--00:1d:0(USB1號控制器) 
  4.                    |                    | 
  5.                    |                    |--00:1d:1(USB2號控制器)                    | 
  6.                    |-00:1e:0(PCI橋)--02:00.0(IEEE1394) 
  7.                    |                | 
  8.                    |                |-02:01.0(8139網卡) 
  9.                    |                | 
  10.                    |                |-02:04(CardBus橋)-02:04.0(橋1) 
  11.                    |                                   | 
  12.                    |                                   |--02:04.1(橋2) 
  13.                    | 
  14.                    |-00:1f(多功能板卡)-00:1f:0(ISA橋) 
  15.                                         | 
  16.                                         |--00:1f:1(IDE接口) 
  17.                                         | 
  18.                                         |--00:1f:3(SMBus) 
  19.                                         | 
  20.                                         |--00:1f:5(多媒體聲音控制器) 
  21.                                         | 
  22.                                         |--00:1f:6(調制解調器) 

由上圖可以得出,我的電腦上共有8個PCI設備,其中0號總線上(主橋)上連有4個,1號總線上連有1個,2號總線上連有3個。00:1f是一個連有5個功能的多功能板卡。

如果要更詳細的信息:

  1. lspci -v 或者 lspci -vv 

如果要看設備樹:lscpi -t

  1. root@ubuntu:/home/peng# lspci -t 

6. usb

查看usb信息

  1. root@ubuntu:/home/peng# lsusb 
  2. Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 
  3. Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub 
  4. Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse 
  5. Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub 

lsusb -t查看系統中的USB拓撲,類似cat /sys/kernel/debug/usb/devices

  1. root@ubuntu:/home/peng# lsusb -t 
  2. /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M 
  3.     |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M 
  4.     |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12M 
  5. /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480M 

/var/lib/usbutils/usb.ids還保存了很多設備商的VID信息

  1. root@ubuntu:/home/peng# cat /var/lib/usbutils/usb.ids | grep King 
  2.  7778  Counterfeit flash drive [Kingston] 
  3.  0100  Kingston Flash Drive (128MB) 
  4.  c010  Kingston FCR-HS2/ATA Card Reader 
  5. 07cb  Kingmax Technology, Inc. 
  6.  4100  Kingsun SF-620 Infrared Adapter 
  7.  4959  Kingsun KS-959 Infrared Adapter 
  8.  0015  Kingston DataTraveler ELITE 
  9.  0016  Kingston DataTraveler U3 
  10.  0998  Kingston Data Traveler2.0 Disk Driver 
  11.  0999  Kingston Data Traveler2.0 Disk Driver 
  12.  6519  Kingston DataTraveler 2.0 USB Stick 
  13.  653c  Kingston DataTraveler 2.0 Stick (512M) 
  14.  653d  Kingston DataTraveler 2.0 Stick (1GB) 
  15.  6544  TransMemory-Mini / Kingston DataTraveler 2.0 Stick (2GB) 
  16.  6545  Kingston DataTraveler 102/2.0 / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick 
  17. 0951  Kingston Technology 
  18. 0d8a  King Jim Co., Ltd 
  19.  00a3  Smart King PRO Uninterruptible Power Supply (HID PDC) 
  20. 0e56  Kingston Technology Company, Inc. 
  21. 0f8e  Kingnet Technology Co., Ltd 
  22. 13fe  Kingston Technology Company Inc. 
  23.  1f00  Kingston DataTraveler / Patriot Xporter 
  24. 1687  Kingmax Digital Inc. 
  25. 16df  King Billion Electronics Co., Ltd. 
  26.  2149  EntropyKing Random Number Generator 

lsusb -v查看系統中USB設備的詳細信息

  1. lsusb -v 

7. lshw查看所有硬件摘要信息

下面命令可以查看所有硬件摘要信息,并輸出成一個html文件,把此html文件導出到電腦上,直接打開,可以清楚的看到硬件信息:

  1. lshw -html > /hardware.html 

8. lsscsi查看SCSI控制器設備的信息

可以看到SCSI信息和所有虛擬磁盤以及光驅的信息,如果沒有硬件SCSI控制器,那就不會返回信息:

  1. root@ubuntu:/home/peng# lsscsi 
  2. [2:0:0:0]    disk    VMware,  VMware Virtual S 1.0   /dev/sda  
  3. [4:0:0:0]    cd/dvd  NECVMWar VMware SATA CD01 1.00  /dev/sr0  

插入一個U盤后再查看:

  1. root@ubuntu:/home/peng# lsscsi 
  2. [2:0:0:0]    disk    VMware,  VMware Virtual S 1.0   /dev/sda  
  3. [4:0:0:0]    cd/dvd  NECVMWar VMware SATA CD01 1.00  /dev/sr0  
  4. [33:0:0:0]   disk    Kingston DataTraveler G2  1.00  /dev/sdb  

可以看到U盤為Kingston。

9. 查看bios信息

  1. root@ubuntu:/home/peng# dmidecode -t bios 
  2. # dmidecode 3.0 
  3. Getting SMBIOS data from sysfs. 
  4. SMBIOS 2.7 present. 
  5.  
  6. Handle 0x0000, DMI type 0, 24 bytes 
  7. BIOS Information 
  8.  Vendor: Phoenix Technologies LTD 
  9.  Version: 6.00 
  10.  Release Date: 07/29/2019 
  11.  Address: 0xEA480 
  12.  Runtime Size: 88960 bytes 
  13.  ROM Size: 64 kB 
  14.  Characteristics: 
  15.   ISA is supported 
  16.   PCI is supported 
  17.   PC Card (PCMCIA) is supported 
  18.   PNP is supported 
  19.   APM is supported 
  20.   BIOS is upgradeable 
  21.   BIOS shadowing is allowed 
  22.   ESCD support is available 
  23.   Boot from CD is supported 
  24.   Selectable boot is supported 
  25.   EDD is supported 
  26.   Print screen service is supported (int 5h) 
  27.   8042 keyboard services are supported (int 9h) 
  28.   Serial services are supported (int 14h) 
  29.   Printer services are supported (int 17h) 
  30.   CGA/mono video services are supported (int 10h) 
  31.   ACPI is supported 
  32.   Smart battery is supported 
  33.   BIOS boot specification is supported 
  34.   Function key-initiated network boot is supported 
  35.   Targeted content distribution is supported 
  36.  BIOS Revision: 4.6 
  37.  Firmware Revision: 0.0 

dmidecode以一種可讀的方式dump出機器的DMI(Desktop Management Interface)信息。這些信息包括了硬件以及BIOS,既可以得到當前的配置,也可以得到系統支持的最大配置,比如說支持的最大內存數等。

如果要查看所有有用信息

  1. dmidecode -q 

里面包含了很多硬件信息。

 

責任編輯:姜華 來源: 一口Linux
相關推薦

2013-01-14 16:00:29

Linux系統

2009-10-15 09:58:13

Linux系統信息查看

2022-04-13 15:10:40

Linuxvmstat分析信息

2009-09-25 10:48:07

Linux硬件信息操作系統

2011-07-19 09:25:52

2010-03-02 14:01:58

Linux硬件信息命令

2014-05-04 10:34:32

Linux硬件信息Linux命令

2015-12-03 09:46:50

收集硬件Linux命令

2019-05-24 14:15:30

Linux硬件信息命令

2009-12-11 15:47:54

Linux硬件信息

2019-11-21 00:00:15

Linuxless命令

2010-06-22 10:28:04

linux at命令

2015-09-23 09:22:01

系統硬件命令

2014-05-15 10:49:09

Linux 硬件信息Linux 命令

2018-07-12 15:03:41

2010-05-19 11:07:12

Linux uptim

2010-03-09 14:30:45

Linux全部硬件信息

2015-12-21 13:34:31

LinuxGPU顯卡硬件

2013-12-17 10:39:24

命令top

2018-02-07 09:25:50

Linux命令touch
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 国产一区2区| 国产伦精品一区二区三区视频金莲 | 成人综合在线视频 | 国产精品高| 亚洲精色| 成人亚洲精品久久久久软件 | 草逼网站 | 亚洲成人免费在线 | 欧美毛片免费观看 | 天天操夜夜操 | 日日日日日日bbbbb视频 | 亚洲国产成人在线视频 | 国产精品不卡一区 | 亚洲一区二区三区在线 | 国产一级视频 | 麻豆久久久久久久久久 | av中文字幕在线 | 精品成人在线视频 | 羞视频在线观看 | 午夜寂寞影院在线观看 | 国产高清久久 | 日日夜夜精品视频 | 天天摸天天看 | 超碰成人免费 | 成人国产精品久久久 | 久久久精品一区二区三区 | 亚洲一区二区三区免费在线观看 | 中文字幕 在线观看 | 国产精品久久久久久一区二区三区 | 亚洲精品视频在线 | 久久99精品久久久久久秒播九色 | 一级毛片视频 | 中文在线a在线 | 日韩在线视频观看 | 日本精品视频 | 电影午夜精品一区二区三区 | 成人精品久久久 | 免费福利视频一区二区三区 | 成人精品国产免费网站 | 欧美男人亚洲天堂 | 国产精品久久久久久久久图文区 |