在linux中查询硬件相关信息

摘要:
12联机CPU列表:0-11线程百分比:0-5NUMAnode1CPU:0 vendor_ id:处理器:yesfpu_异常:64cache_ alignment:处理器:GenuineIntelcpu系列:

1、查询cpu的相关

  a、查询CPU的统计信息

  使用命令:lscpu

  得到的结果如下:

  

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                12
On-line CPU(s) list:   0-11
Thread(s) per core:    1
Core(s) per socket:    6
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Stepping:              4
CPU MHz:               2099.939
BogoMIPS:              4199.44
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              15360K
NUMA node0 CPU(s):     0-5
NUMA node1 CPU(s):     6-11

  b、查询每个CPU信息  

  使用的命令:cat /proc/cpuinfo

  得到如下结果:

processor    : 0
vendor_id    : GenuineIntel
cpu family    : 6
model        : 62
model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping    : 4
cpu MHz        : 2099.939
cache size    : 15360 KB
physical id    : 0
siblings    : 6
core id        : 0
cpu cores    : 6
apicid        : 0
initial apicid    : 0
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : 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 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips    : 4199.87
clflush size    : 64
cache_alignment    : 64
address sizes    : 46 bits physical, 48 bits virtual
power management:

processor    : 1
vendor_id    : GenuineIntel
cpu family    : 6
model        : 62
model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping    : 4
cpu MHz        : 2099.939
cache size    : 15360 KB
physical id    : 0
siblings    : 6
core id        : 1
cpu cores    : 6
apicid        : 2
initial apicid    : 2
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : 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 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips    : 4199.87
clflush size    : 64
cache_alignment    : 64
address sizes    : 46 bits physical, 48 bits virtual
power management:

processor    : 2
vendor_id    : GenuineIntel
cpu family    : 6
model        : 62
model name    : Intel(R) Xeon(R) CPU E5-2620 v2 @ 2.10GHz
stepping    : 4
cpu MHz        : 2099.939
cache size    : 15360 KB
physical id    : 0
siblings    : 6
core id        : 2
cpu cores    : 6
apicid        : 4
initial apicid    : 4
fpu        : yes
fpu_exception    : yes
cpuid level    : 13
wp        : yes
flags        : 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 cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms
bogomips    : 4199.87
clflush size    : 64
cache_alignment    : 64
address sizes    : 46 bits physical, 48 bits virtual
power management:

2、查询所有的pci设备信息(pci是一种总线,而通过pci总线连接的设备就是pci设备了,如今,我们常用的设备很多都采用pci总线了,如网卡存储等)

  使用命令:lspci

  得到结果:

0:00.0 Host bridge: Intel Corporation Xeon E5 v2/Core i7 DMI2 (rev 04)
00:01.0 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 1a (rev 04)
00:01.1 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 1b (rev 04)
00:02.0 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 2a (rev 04)
00:03.0 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 3a (rev 04)
00:03.2 PCI bridge: Intel Corporation Xeon E5 v2/Core i7 PCI Express Root Port 3c (rev 04)
00:04.0 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 0 (rev 04)
00:04.1 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 1 (rev 04)
00:04.2 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 2 (rev 04)
00:04.3 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 3 (rev 04)
00:04.4 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 4 (rev 04)
00:04.5 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 5 (rev 04)
00:04.6 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 6 (rev 04)
00:04.7 System peripheral: Intel Corporation Xeon E5 v2/Core i7 Crystal Beach DMA Channel 7 (rev 04)
00:05.0 System peripheral: Intel Corporation Xeon E5 v2/Core i7 VTd/Memory Map/Misc (rev 04)
00:05.2 System peripheral: Intel Corporation Xeon E5 v2/Core i7 IIO RAS (rev 04)
00:05.4 PIC: Intel Corporation Xeon E5 v2/Core i7 IOAPIC (rev 04)
00:11.0 PCI bridge: Intel Corporation C600/X79 series chipset PCI Express Virtual Root Port (rev 06)
00:16.0 Communication controller: Intel Corporation C600/X79 series chipset MEI Controller #1 (rev 05)
00:16.1 Communication controller: Intel Corporation C600/X79 series chipset MEI Controller #2 (rev 05)
00:1a.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #2 (rev 06)
00:1d.0 USB controller: Intel Corporation C600/X79 series chipset USB2 Enhanced Host Controller #1 (rev 06)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev a6)
00:1f.0 ISA bridge: Intel Corporation C600/X79 series chipset LPC Controller (rev 06)
00:1f.2 SATA controller: Intel Corporation C600/X79 series chipset 6-Port SATA AHCI Controller (rev 06)
00:1f.3 SMBus: Intel Corporation C600/X79 series chipset SMBus Host Controller (rev 06)
00:1f.6 Signal processing controller: Intel Corporation C600/X79 series chipset Thermal Management Controller (rev 06)
02:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
02:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
06:00.0 Network controller: Mellanox Technologies MT27500 Family [ConnectX-3]
08:04.0 VGA compatible controller: Matrox Electronics Systems Ltd. MGA G200eW WPCM450 (rev 0a)

如果要利用lscpi查询网卡型号可以使用命令:lspci |grep Ethernet

得到结果:

02:00.0 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)
02:00.1 Ethernet controller: Intel Corporation I350 Gigabit Network Connection (rev 01)

3、查询内存相关信息

  a、查看内存大小

  使用命令:free

  得到内存的一个整体信息如下:

             total       used       free     shared    buffers     cached
Mem:      16364948    1623020   14741928          0     549616     291172
-/+ buffers/cache:     782232   15582716
Swap:     16383992      81560   16302432

  b、查看详细信息

  使用命令:cat /proc/meminfo

  结果:

MemTotal:       16364948 kB
MemFree:        14742988 kB
Buffers:          549660 kB
Cached:           291340 kB
SwapCached:        14724 kB
Active:           241052 kB
Inactive:         646568 kB
Active(anon):      32216 kB
Inactive(anon):    14800 kB
Active(file):     208836 kB
Inactive(file):   631768 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      16383992 kB
SwapFree:       16302432 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:         38996 kB
Mapped:            13080 kB
Shmem:               388 kB
Slab:             340196 kB
SReclaimable:     210436 kB
SUnreclaim:       129760 kB
KernelStack:        4744 kB
PageTables:        12496 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    24566464 kB
Committed_AS:     553868 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      429696 kB
VmallocChunk:   34349265164 kB
HardwareCorrupted:     0 kB
AnonHugePages:      8192 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        4868 kB
DirectMap2M:     2058240 kB
DirectMap1G:    14680064 kB

4、查看系统内核相关信息

  使用命令:uname -a

  结果:

Linux cn13 2.6.32-431.el6.x86_64 #1 SMP Sun Nov 10 22:19:54 EST 2013 x86_64 x86_64 x86_64 GNU/Linux

  查看系统版本

  使用命令:cat /etc/issue

  结果:

Red Hat Enterprise Linux Server release 6.5 (Santiago)

5、利用dmindecode查看硬件信息

查看服务器型号
dmidecode | grep 'product name'
查看主板序列号
dmidecode | grep 'Serial Number'
查看系统序列号
dmidecode -s systems-serial-number
查看内存信息
dmidecode -t memory
查看oem信息
dmidecode -t 11

**6、利用ibstat查看infiniband网卡的信息:

结果:

CA 'mlx4_0'
    CA type: MT4099
    Number of ports: 1
    Firmware version: 2.30.8000
    Hardware version: 0
    Node GUID: 0x002590fffff7761c
    System image GUID: 0x002590fffff7761f
    Port 1:
        State: Active
        Physical state: LinkUp
        Rate: 40
        Base lid: 85
        LMC: 0
        SM lid: 229
        Capability mask: 0x02514868
        Port GUID: 0x002590fffff7761d
        Link layer: InfiniBand

免责声明:内容来源于网络,仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇MiniMapX简介纵向文字滚动代码,带上下图片控制的。鼠标放到上下图片上时滚动下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

前端json数据格式化显示

1、格式化处理 1 var obj = "...";//json格式的字符串 2 var jsonPretty = JSON.stringify(JSON.parse(obj),null,2); 2、显示 只需把格式化处理后的json字符串数据放到 pre标签 中即可。 3、demo js代码(直接是对象,所以省略JSON.parse操作) 1 let...

tcl/tk之流程控制命令

作为学习笔记,写下来仅供自己查阅。 tcl脚本命令风格有些类似linux命令,比较古老和原始的语言,学过linux的看起来应该毫无压力 if 命令 if {$x < 0} {     set x 0 }   if {$x < 0} {     ... } elseif {$x == 0} {     ... } elseif {$x == 1}...

统计一个版本代码变化行数

项目总结时,我们常常需要统计代码行数,来查看每个项目开发者的代码总量,提交次数和变更文件数。 这里介绍一下statsvn工具统计代码行数的方法。   1、安装tortoise svn 下载tortoise svn,下载地址:https://tortoisesvn.net/downloads.html,附件给出了64位的版本。 点击运行,按照提示安装完成。...

Linux 下 SSH 命令实例指南

如果你已经在IT圈内混久了, 应该对 SSH 这个了不起的工具及其安全特性有所耳闻吧. 本教程可以让你在短时间内掌握通过 SSH 安全便利地连接到远程计算机的技术. 如果你对 SSH 还没什么概念, 可以先访问 维基百科 进行了解. 基本用法 最简单的 SSH 命令只需要指定用户名和主机名参数即可. 主机名可以是 IP 地址或者域名. 命令格式如下:...

VulnHub::Moee

实验环境 存在4个flag 渗透过程 0x01 信息搜集 GET IP 由于不知道靶机IP地址,进行D段扫描,获得靶机IP地址。 masscan扫描: masscan 192.168.2.0/24 -p80 --rate 1000 Starting masscan 1.0.5 (http://bit.ly/14GZzcT) at 2020-12-05 0...

【鸿蒙开发板】使用AT命令连接WIFI

目录:1. AT+STARTSTA2. AT+SCAN3. AT+SCANRESULT4. AT+CONN=,08:6b:d1:93:a5:72,3,"12345678"5. AT+DHCP=wlan0,1 使用AT指定将wifi-iot设备连接到WIFI 工具:sscom 核心步骤: 启动station模式 连接wifi热点 启动DHCP客户端获取ip...