Linux查看硬件信息命令
一、查看服务器硬件信息
(1)查看服务器型号、序列号
[root@Master ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product|Serial"
(2)查看主板型号
[root@Master ~]# dmidecode |grep -A16 "System Information$"
(3)查看BIOS信息
[root@Master ~]# dmidecode -t bios# dmidecode 2.12SMBIOS 2.8 present.Handle 0x0008, DMI type 0, 24 bytesBIOS InformationVendor: HPVersion: U19Release Date: 12/27/2015Address: 0xF0000Runtime Size: 64 kBROM Size: 16384 kBCharacteristics:PCI is supportedPNP is supportedBIOS is upgradeableBIOS shadowing is allowedESCD support is availableBoot from CD is supportedSelectable boot is supportedEDD is supported5.25"/360 kB floppy services are supported (int 13h)5.25"/1.2 MB floppy services are supported (int 13h)3.5"/720 kB floppy services are supported (int 13h)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 supportedUSB legacy is supportedBIOS boot specification is supportedFunction key-initiated network boot is supportedTargeted content distribution is supportedUEFI is supportedBIOS Revision: 2.0Firmware Revision: 2.40
(3)查看内存槽及内存条
[root@Master ~]# dmidecode -t memory | head -45 | tail -23Memory DeviceArray Handle: 0x000AError Information Handle: Not ProvidedTotal Width: 72 bitsData Width: 64 bitsSize: 16384 MBForm Factor: DIMMSet: NoneLocator: PROC 1 DIMM 1Bank Locator: Not SpecifiedType: DDR4Type Detail: Synchronous Registered (Buffered)Speed: 2133 MHzManufacturer: HP Serial Number: Not SpecifiedAsset Tag: Not SpecifiedPart Number: 752369-081Rank: 2Configured Clock Speed: 2133 MHzMinimum Voltage: 1.2 VMaximum Voltage: 1.2 VConfigured Voltage: 1.2 V[root@Master ~]#
(4)查看网卡信息
[root@Master ~]# dmesg | grep -i Etheetigb: Intel(R) Gigabit Etheet Network Driver - version 5.3.0-kigb 0000:04:00.0: Intel(R) Gigabit Etheet Network Connectionigb 0000:04:00.1: Intel(R) Gigabit Etheet Network Connectionigb 0000:04:00.2: Intel(R) Gigabit Etheet Network Connectionigb 0000:04:00.3: Intel(R) Gigabit Etheet Network Connectionigb 0000:02:00.0: Intel(R) Gigabit Etheet Network Connectionigb 0000:02:00.1: Intel(R) Gigabit Etheet Network Connection
(5) 查看pci信息,即主板所有硬件槽信息
[root@Master ~]# lspci | head -1000:00.0 Host bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 DMI2 (rev 02)00:01.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02)00:01.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 1 (rev 02)00:02.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:02.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:02.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:02.3 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 2 (rev 02)00:03.0 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)00:03.1 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)00:03.2 PCI bridge: Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 PCI Express Root Port 3 (rev 02)
二、查看CPU信息
(1)查看cpu型号
[root@Master ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c 40 Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
(2)查看系统中实际物理CPU的数量(物理)
[root@Master ~]# grep 'physical id' /proc/cpuinfo | sort | uniq | wc -l2
(3)系统中实际物理CPU的数量(核数)
[root@Master ~]# cat /proc/cpuinfo |grep 'processor'|wc -l40
(4)查看每个物理CPU中core的个数(即核数)
[root@Master ~]# cat /proc/cpuinfo |grep "cores"|uniq cpu cores: 10
(5)查看CPU的主频
[root@Master ~]# cat /proc/cpuinfo |grep MHz|uniq cpu MHz : 1200.000cpu MHz : 2300.000cpu MHz : 1200.000
(6)查看CPU的详细信息
[root@Master ~]# cat /proc/cpuinfo | head -20processor: 0 //逻辑处理器的IDvendor_id: GenuineIntelcpu family : 6model: 63model name : Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz//CPU型号stepping: 2microcode: 54cpu MHz : 1200.000cache size : 25600 KBphysical id : 0siblings: 20//相同物理封装处理器中逻辑处理器数core id : 0cpu cores: 10 //相同物理封装处理器中的内核数apicid : 0initial apicid : 0fpu : yesfpu_exception: yescpuid level : 15wp : yesflags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm cqm_llc cqm_occup_llc
(7)查看CPU的相关信息
[root@Master ~]# lscpuArchitecture: x86_64CPU op-mode(s):32-bit, 64-bitByte Order:Little EndianCPU(s):40On-line CPU(s) list:0-39Thread(s) per core:2Core(s) per socket:10Socket(s): 2NUMA node(s): 2Vendor ID: GenuineIntelCPU family:6Model: 63Model name:Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHzStepping: 2CPU MHz:1200.000BogoMIPS: 4594.43Virtualization:VT-xL1d cache: 32KL1i cache: 32KL2 cache: 256KL3 cache: 25600KNUMA node0 CPU(s): 0-9,20-29NUMA node1 CPU(s): 10-19,30-39[root@Master ~]#
(8)查看cpu运行模式
[root@Master ~]# getconf LONG_BIT64
(9)查看cpu是否支持64bit
[root@Master ~]# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l40(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)
三、查看内存信息
(1)查看内存硬件信息
root@Master ~]# dmidecode -t memory | head -45 | tail -24Handle 0x000C, DMI type 17, 40 bytesMemory DeviceArray Handle: 0x000AError Information Handle: Not ProvidedTotal Width: 72 bitsData Width: 64 bitsSize: 16384 MBForm Factor: DIMMSet: NoneLocator: PROC 1 DIMM 1Bank Locator: Not SpecifiedType: DDR4Type Detail: Synchronous Registered (Buffered)Speed: 2133 MHzManufacturer: HP Serial Number: Not SpecifiedAsset Tag: Not SpecifiedPart Number: 752369-081Rank: 2Configured Clock Speed: 2133 MHzMinimum Voltage: 1.2 VMaximum Voltage: 1.2 VConfigured Voltage: 1.2 V
(2)最大支持多少内存
[root@Master ~]# dmidecode|grep -P 'Maximum\s+Capacity'
(3)Linux 查看内存的插槽数,已经使用多少插槽.每条内存多大:
(4)Linux 查看内存的频率:
[root@Master ~]# dmidecode|grep -A16 "Memory Device"|grep 'Speed'
(5)Linux 查看内存的详细信息:
[root@Master ~]# cat /proc/meminfo |head -20MemTotal:131897620 kBMemFree: 414124 kBBuffers: 1040560 kBCached: 111083180 kBSwapCached: 1320 kBActive: 7637912 kBInactive:110607108 kBActive(anon):4406900 kBInactive(anon): 1714900 kBActive(file):3231012 kBInactive(file): 108892208 kBUnevictable:10878976 kBMlocked: 5521652 kBSwapTotal: 16777212 kBSwapFree:16737536 kBDirty:180 kBWriteback: 0 kBAnonPages: 16999324 kBMapped:149020 kBShmem:172 kB
(6)Linux 查看内存的使用情况
[root@Master ~]# free -m // -b,-k,-m,-g show output in bytes, KB, MB, or GB totalusedfree sharedbuffers cachedMem:128806 1234075398 01015 103474-/+ buffers/cache: 18918 109888Swap:16383 38 16345
四、查看硬盘信息
(1)查看挂接的分区状态
[root@Master ~]# fdisk -l |grep Disk
(2)查看硬盘和分区分布
[root@Master ~]# lsblkNAMEMAJ:MIN RMSIZE RO TYPE MOUNTPOINTsda 8:00 279.4G 0 disk ├─sda18:1050M 0 part /boot├─sda28:20100G 0 part /├─sda38:3050G 0 part /home├─sda48:40 1K 0 part ├─sda58:5016G 0 part [SWAP]├─sda68:60 13.3G 0 part /tmp└─sda78:70100G 0 part /usrsdb 8:160 83.7T 0 disk └─sdb18:170 83.7T 0 part /PureDisk
(3)查看硬盘和分区的详细信息
[root@Master ~]# fdisk -lDisk /dev/sda: 300.0 GB, 299966445568 bytes255 heads, 63 sectors/track, 36468 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 262144 bytes / 262144 bytesDisk identifier: 0x000384d9Device Boot Start End BlocksId System/dev/sda1*175120083 LinuxPartition 1 does not end on cylinder boundary./dev/sda271306110485760083 Linux/dev/sda313061195885242880083 Linux/dev/sda419588364691355970565 Extended/dev/sda519588216771677721682 Linux swap / Solaris/dev/sda621677234151396224083 Linux/dev/sda7234163646910485452883 LinuxWARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.Disk /dev/sdb: 92017.3 GB, 92017310654464 bytes255 heads, 63 sectors/track, 11187134 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 262144 bytes / 6029312 bytesDisk identifier: 0x00000000Device Boot Start End BlocksId System/dev/sdb11 267350 2147483647+ ee GPTPartition 1 does not start on physical sector boundary.
(4)查看挂接的分区状态
[root@Master ~]# mount | column -t/dev/sda2 on / type ext4 (rw)procon /proc type proc (rw)sysfs on /sys type sysfs(rw)devpts on /dev/pts type devpts(rw,gid=5,mode=620)tmpfs on /dev/shm type tmpfs(rw)/dev/sda1 on /boot type ext4 (rw)/dev/sda3 on /home type ext4 (rw)/dev/sda6 on /tmp type ext4 (rw)/dev/sda7 on /usr type ext4 (rw)/dev/sdb1 on /PureDisk type ext4 (rw)noneon /proc/sys/fs/binfmt_misc type binfmt_misc (rw
(5)查看挂接的分区状态
[root@Master ~]# swapon -sFilenameTypeSizeUsedPriority/dev/sda5partition1677721239676-1
(6)查看硬盘使用情况
[root@Master ~]# df -hTFilesystem TypeSize Used Avail Use% Mounted on/dev/sda2 ext499G 561M93G1% /tmpfs tmpfs63G76K63G1% /dev/shm/dev/sda1 ext445M38M 4.9M 89% /boot/dev/sda3 ext450G52M47G1% /home/dev/sda6 ext413G34M13G1% /tmp/dev/sda7 ext499G21G73G 23% /usr/dev/sdb1 ext484T41T40T 51% /PureDisk
(7) 硬盘检测命令smartctl
[root@Master ~]# smartctl -a /dev/sdasmartctl 5.43 2012-06-30 r3573 [x86_64-linux-2.6.32-642.el6.x86_64] (local build)Copyright (C) 2002-12 by Bruce Allen, http://smartmontools.sourceforge.netVendor:HP Product: LOGICAL VOLUME Revision: 3.56User Capacity:299,966,445,568 bytes [299 GB]Logical block size:512 bytesLogical Unit id: 0x600508b1001cc8a1b9ec4dacc5ab35dcSerial number:PDNNK0BRH9U0AG Device type: diskLocal Time is:Mon Feb 5 13:13:33 2018 CSTDevice supports SMART and is EnabledTemperature Waing Disabled or Not SupportedSMART Health Status: OKError Counter logging not supportedDevice does not support Self Test logging
五、查看网卡信息
(1)查看网卡硬件信息
[root@Master ~]# lspci | grep -i 'eth'
(2)查看系统的所有网络接口
[root@Master ~]# ifconfig -a[root@Master ~]# ip link show
(3)查看某个网络接口的详细信息,例如eth0的详细参数和指标
[root@Master ~]# ethtool eth0Settings for eth0:Supported ports: [ FIBRE ]Supported link modes:10000baseT/Full Supported pause frame use: NoSupports auto-negotiation: NoAdvertised link modes: 10000baseT/Full Advertised pause frame use: NoAdvertised auto-negotiation: NoSpeed: 10000Mb/sDuplex: FullPort: FIBREPHYAD: 0Transceiver: extealAuto-negotiation: offSupports Wake-on: dWake-on: dCurrent message level: 0x00000007 (7)drv probe linkLink detected: yes
(4)查看所有网卡的链路状态
[root@Master ~]# for i in `seq 0 9`;do ethtool eth${i} | egrep 'eth|Link';doneSettings for eth0:Link detected: yesSettings for eth1:Link detected: yesSettings for eth2:Link detected: noSettings for eth3:Link detected: noSettings for eth4:Link detected: noSettings for eth5:Link detected: noSettings for eth6:Link detected: noSettings for eth7:Link detected: noSettings for eth8:Link detected: noSettings for eth9:Link detected: no
六、列出所有PCI设备信息
[root@Master ~]# lspci -tv | more-+-[0000:ff]-+-08.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 0 |+-08.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 0 |+-09.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 1 |+-09.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 QPI Link 1 |+-0b.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring |+-0b.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring |+-0b.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 R3 QPI Link 0 & 1 Monitoring |+-0c.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.4 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.5 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.6 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0c.7 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0d.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0d.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Unicast Registers |+-0f.0 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent |+-0f.1 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent |+-0f.2 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent |+-0f.3 Intel Corporation Xeon E7 v3/Xeon E5 v3/Core i7 Buffered Ring Agent
作者:cloudos
来源链接:https://www.cnblogs.com/cloudos/p/8416415.html
版权声明:
1、JavaClub(https://www.javaclub.cn)以学习交流为目的,由作者投稿、网友推荐和小编整理收藏优秀的IT技术及相关内容,包括但不限于文字、图片、音频、视频、软件、程序等,其均来自互联网,本站不享有版权,版权归原作者所有。
2、本站提供的内容仅用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律的规定,不得侵犯相关权利人及本网站的合法权利。
3、本网站内容原作者如不愿意在本网站刊登内容,请及时通知本站(javaclubcn@163.com),我们将第一时间核实后及时予以删除。