In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "Linux commonly used to view system hardware information commands", interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Linux commonly used to view system hardware information commands" it!
Execution environment: ubuntu 16.04
1. Cpu
The lscpu command is used to view the statistics of cpu.
Root@ubuntu:/home/peng/# lscpu Architecture: x86'64 # cpu architecture CPU op-mode (s): 32-bit, 64-bit Byte Order: Little Endian # small tail CPU (s): 1 # there is a total of 1 core On-line CPU (s) list: 0 Thread (s) per core: 1 # each cpu core Only one thread can be supported That is, hyperthreading Core (s) per socket: 1 Socket (s): 1 NUMA node (s): 1 Vendor ID: GenuineIntel # cpu manufacturer intel CPU family: 6 Model: 158 Model name: Intel (R) Core (TM) i5-7500 CPU @ 3.40GHz Stepping: 9 CPU MHz: 3408.070 BogoMIPS: 6816.14 Hypervisor vendor: VMware Virtualization type: full # supports cpu virtualization technology L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 6144K NUMA node0 CPU (s): 0
Check / proc/cpuinfo, you can know each cpu information, such as the model of each CPU, main frequency and so on.
Root@ubuntu:/home/peng# cat / proc/cpuinfo processor: 0 vendor_id: GenuineIntel cpu family: 6 model: 158 model name: Intel (R) Core (TM) i5-7500 CPU @ 3.40GHz stepping: 9 microcode: 0x48 cpu MHz: 3408.070 cache size: 6144 KB physical id: 0 siblings: 1 core id: 0 cpu cores: 1 apicid: 0 initial apicid: 0 fpu: yes fpu_exception: yes cpuid level: 22 wp: yes .2. Memory
Summary view memory situation
Root@ubuntu:/home/peng# free-m total used free shared buff/cache available Mem: 1970 702 315 13 952 1025 Swap: 974 20 954
The unit here is MB, and the total memory is 1970MB.
View detailed memory usage
Root@ubuntu:/home/peng# cat / proc/meminfo MemTotal: 2017516 kB MemFree: 242020 kB MemAvailable: 1003240 kB Buffers: 104192 kB Cached: 699824 kB SwapCached: 1832 kB Active: 696320 kB Inactive: 639924 kB Active (anon): 236412 kB Inactive (anon): 301996 kB Active (file): 459908 kB Inactive (file): 337928 kB Unevictable: 48 kB Mlocked: 48 kB.
View memory hardware information
Root@ubuntu:/home/peng# dmidecode-t memory # dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. Handle 0x0084, DMI type 5, 46 bytes Memory Controller Information Error Detecting Method: None Error Correcting Capabilities: None Supported Interleave: One-way Interleave Current Interleave: One-way Interleave Maximum Memory Module Size: 32768 MB Maximum Total Memory Size: 491520 MB Supported Speeds: 70 ns 60 ns Supported Memory Types: FPM EDO DIMM SDRAM Memory Module Voltage: 3.3 V Associated Memory Slots: 15.
The maximum memory value is 491520 MB.
3. Magnetic disk
View hard disk and partition distribution
Root@ubuntu:/home/peng# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom sda 8:0 0 500G 0 disk ├─ sda2 8:2 0 1K 0 part ├─ sda5 8:5 0 975M 0 part [SWAP] └─ sda1 8:1 0 499G 0 part /
View the details of hard drives and partitions
Root@ubuntu:/home/peng# fdisk-l Disk / dev/sda: 500GiB, 536870912000 bytes 1048576000 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes minimum/optimal: 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x9c674a44 Device Boot Start End Sectors Size Id Type / dev/sda1 * 2048 1046575103 1046573056 499G 83 Linux / dev/sda2 1046577150 1048573951 1996802 975M 5 Extended / dev/sda5 1046577152 1048573951 1996800 975M 82 Linux swap / Solaris4. Network card
View Nic hardware information
Root@ubuntu:/home/peng# lspci | grep-I 'eth' 02 eth' 01.0 Ethernet controller: Intel Corporation 82545EM Gigabit Ethernet Controller (Copper) (rev 01)
View all network interfaces of the system
Root@ubuntu:/home/peng# ifconfig-an ens33 Link encap:Ethernet HWaddr 00:0c:29:bb:bd:40 inet addr:192.168.0.117 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::76fa:5548:3da0:2ef/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:174629 errors:0 dropped:0 overruns: 0 frame:0 TX packets:105285 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:237519396 (237.5 MB) TX bytes:9592767 (9.5 MB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: 1thumb 128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:854 errors:0 dropped:0 overruns:0 frame:0 TX packets:854 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:60894 (60.8 KB) TX bytes:60894 (60.8 KB)
Or
Root@ubuntu:/home/peng# ip link show 1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 2: ens33: mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000 link/ether 00:0c:29:bb:bd:40 brd ff:ff:ff:ff:ff:ff
Or
If you want to view the details of a network interface, such as the detailed parameters and metrics of ens33
[some ubuntu ports are eth0]
Root@ubuntu:/home/peng# ethtool ens33 Settings for ens33: Supported ports: [TP] Supported link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full # supports gigabit half-duplex 1000baseT/Full Supported pause frame use: No Supports auto-negotiation: Yes # defaults to adaptive mode Advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT/Full 1000baseT/Full Advertised pause frame use: No Advertised auto-negotiation: Yes Speed: 1000Mb/s # the speed of the Nic is 1000Mb Duplex: Full # full duplex Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: on MDI-X: off (auto) Supports Wake-on: d Wake-on: d Current message level: 0x00000007 (7) drv probe link Link detected: yes # indicates a network cable connection And routing are connected 5. Pci
View the pci information, that is, all hardware slot information on the motherboard.
Root@ubuntu:/home/peng# lspci 82845 (Brookdale) Chipset Host Bridge (rev 04) 01.0 PCI bridge: Intel Corporation 82845 845 (Brookdale) Chipset AGP Bridge (rev 04) 00:1d.0 USB Controller: Intel Corporation 82801CA/CAM USB (Hub # 1) (rev 02) 00:1d.1 USB Controller: Intel Corporation 82801CA/CAM USB (Hub # 2) (rev 02) 00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev 42) 00:1f.0 ISA bridge: Intel Corporation 82801CAM ISA Bridge (LPC) (rev 02) 00:1f.1 IDE interface: Intel Corporation 82801CAM IDE U100 (rev 02) 00:1f.3 SMBus: Intel Corporation 82801CA/CAM SMBus Controller (rev 02) 00:1f.5 Multimedia audio controller:Intel Corporation 82801CA/CAM AC'97 Audio Controller (rev 02) 00:1f.6 Modem: Intel Corporation 82801CA/CAM AC'97 Modem Controller (rev 02) 01Intel Corporation 82801CAM ISA Bridge 00.0 VGA compatible controller: nVidia Corporation NV17 [GeForce4 420 Go] (rev a3) 02 Go 00.0 FireWire (IEEE 1394): VIA Technologies Inc. IEEE 1394 Host Controller (rev 46) 02 Host Controller 01.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10) 02 Host Controller 04.0 CardBus bridge: O2 Micro, Inc. OZ6933 Cardbus Controller (rev 01) 02Host Controller 04.1 CardBus bridge: O2 Micro, Inc. OZ6933 Cardbus Controller (rev 01)
As can be seen from the above output, there are three PCI buses (No. 0, No. 1, No. 2) on my computer. On a single system, the insertion of multiple buses is accomplished through a bridge, which is a special PCI peripheral used to connect the bus. Therefore, the overall layout of the PCI system is organized as a tree, and we can draw the tree structure of the PCI system on my computer through the lspci output above:
00USB 00.0 (main bridge)-00USB 01.0 (PCI bridge)-01:00:0 (nVidia graphics card) | |-- 00USB 1D (USB1 controller)-00:1d:0 (USB1 controller) | |-- 00:1d:1 (USB2 controller) | |-00:1e:0 (PCI Bridge)-- 0200:1e:0 00.0 (IEEE1394) |-0200:1e:0 01.0 (8139 Nic) | | |-02:04 (CardBus Bridge)-02 04.0 (Bridge 1) |-- 02 04.1 (Bridge 2) | | |-0000:1f:1 1f (multi-function board)-00:1f:0 (ISA bridge) | |-- 00:1f:1 (IDE interface) | |-- 00:1f:3 (SMBus) | |-- 00:1f:5 (multimedia sound controller) |-- 00:1f:6 (modem)
As can be seen from the figure above, there are eight PCI devices on my computer, of which there are four on bus 0 (main bridge), one on bus 1 and three on bus 2. 00Rank 1f is a multi-function board with 5 functions.
For more detailed information:
Lspci-v or lspci-vv
If you want to see the device tree: lscpi-t
Root@ubuntu:/home/peng# lspci-T6. Usb
View usb information
Root@ubuntu:/home/peng# lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 002 Device 003: ID 0e0f:0002 VMware, Inc. Virtual USB Hub Bus 002 Device 002: ID 0e0f:0003 VMware, Inc. Virtual Mouse Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Lsusb-t view the USB topology in the system, similar to cat / sys/kernel/debug/usb/devices
Root@ubuntu:/home/peng# lsusb-t /: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12m | _ _ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12m | _ _ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/7p, 12m /: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/6p, 480m
/ var/lib/usbutils/usb.ids also keeps the VID information of many equipment vendors.
Root@ubuntu:/home/peng# cat / var/lib/usbutils/usb.ids | grep King 7778 Counterfeit flash drive [Kingston] 0100 Kingston Flash Drive (128MB) c010 Kingston FCR-HS2/ATA Card Reader 07cb Kingmax Technology Inc. 4100 Kingsun SF-620 Infrared Adapter 4959 Kingsun KS-959 Infrared Adapter 0015 Kingston DataTraveler ELITE 0016 Kingston DataTraveler U3 0998 Kingston Data Traveler2.0 Disk Driver 0999 Kingston Data Traveler2.0 Disk Driver 6519 Kingston DataTraveler 2.0 USB Stick 653c Kingston DataTraveler 2.0 Stick (512m) 653d Kingston DataTraveler 2.0 Stick (1GB) 6544 TransMemory-Mini / Kingston DataTraveler 2.0 Stick (2GB) 6545 Kingston DataTraveler 102 HEMA Flash Drive 2GB / PNY Attache 4GB Stick 0951 Kingston Technology 0d8a King Jim Co., Ltd 00a3 Smart King PRO Uninterruptible Power Supply (HID PDC) 0e56 Kingston Technology Company Inc. 0f8e Kingnet Technology Co., Ltd 13fe Kingston Technology Company Inc. 1f00 Kingston DataTraveler / Patriot Xporter 1687 Kingmax Digital Inc. 16df King Billion Electronics Co., Ltd. 2149 EntropyKing Random Number Generator
Lsusb-v to view the details of USB devices in the system
Lsusb-v7. Lshw views all hardware summary information
The following command can view all the hardware summary information, and output into a html file, export this html file to the computer, directly open, you can clearly see the hardware information:
Lshw-html > / hardware.html8. Lsscsi views information about SCSI controller devices
You can see the SCSI information and information about all virtual disks and optical drives. If there is no hardware SCSI controller, the information will not be returned:
Root@ubuntu:/home/peng# lsscsi [2:0:0:0] disk VMware, VMware Virtual S 1.0 / dev/sda [4:0:0:0] cd/dvd NECVMWar VMware SATA CD01 1.00 / dev/sr0
Insert a flash drive and then check:
Root@ubuntu:/home/peng# lsscsi [2:0:0:0] disk VMware, VMware Virtual S 1.0 / dev/sda [4:0:0:0] cd/dvd NECVMWar VMware SATA CD01 1.00 / dev/sr0 [33:0:0:0] disk Kingston DataTraveler G2 1.00 / dev/sdb
You can see that the USB flash drive is Kingston.
9. View the bios information root@ubuntu:/home/peng# dmidecode-t bios # dmidecode 3.0 Getting SMBIOS data from sysfs. SMBIOS 2.7 present. Handle 0x0000, DMI type 0 24 bytes BIOS Information Vendor: Phoenix Technologies LTD Version: 6.00 Release Date: 07 int 29is supported PNP is supported APM is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported EDD is supported Print screen service is supported 2019 Address: 0xEA480 Runtime Size: 88960 bytes ROM Size: 64 kB Characteristics: ISA is supported PCI is supported PC Card (PCMCIA) is supported PNP is supported APM is supported BIOS is upgradeable BIOS shadowing is allowed ESCD support is available Boot from CD is supported Selectable boot is supported EDD is supported Print screen service is supported (int 5h) 8042 keyboard services are supported (int 9h) Serial services are supported (int 14h) Printer services are supported (int 17h) CGA/mono video services are supported (int 10h) ACPI is supported Smart battery is supported BIOS boot specification is supported Function key-initiated network boot is supported Targeted content distribution is supported BIOS Revision: 4.6 Firmware Revision: 0.0
Dmidecode dump the machine's DMI (Desktop Management Interface) information in a readable manner. This information includes hardware and BIOS, which can get both the current configuration and the maximum configuration supported by the system, such as the maximum amount of memory supported.
If you want to see all the useful information
Dmidecode-Q here, I believe that everyone on the "Linux commonly used to view system hardware information commands" have a deeper understanding, might as well to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.