1、查看系统PCI设备
lspci命令可以列出所有的PCI设备,比如主板、声卡、显卡和网卡等如下
[root@localhost ~]# lspci
输出结果如下。
00:00.0 Host bridge: Intel Corporation 945G/P Memory Controller Hub (rev 02)
00:02.0 VGA compatible controller: Intel Corporation 945G Integrated Graphics Controller
(rev 02)
00:1b.0 Class 0403: Intel Corporation 82801G (ICH7 Family) High Definition Audio
Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPCInterfaceBridge (rev 01)
00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller
[AHCI mode] (rev 02)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Realtek Semiconductor Co.,Ltd.: Realtek device 8168 (rev 01)
下面分析一下这个机器中就有什么类型的设备。
00:00.0 Host bridge: Intel Corporation 945G/P Memory Controller Hub (rev 02)
上面显示的集成主板设备的类型为Intel Corporation 945G/P。
00:02.0 VGA compatible controller: Intel Corporation 945G Integrated Graphics Controller
(rev 02)
上面显示的是VGA显卡设备。
00:1b.0 Class 0403: Intel Corporation 82801G (ICH7 Family) High Definition Audio
Controller (rev 01)
上面显示的是Intel声卡设备。
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI #4 (rev 01)
上面显示了4个USB接⼜设备。
00:0d.0 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller
[AHCI mode] (rev 02)
上面显示了一个SATA控制器,表明系统是SATA系列硬盘。
02:00.0 Ethernet controller: Intel Corporation 82540EM Gigabit Ethernet Controller (rev 02)
上面显示的是千兆⽹卡设备。
2、查看CPU信息
[root@localhost ~]# more /proc/cpuin输出结果如下processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 62
model name : Intel(R) Xeon(R) CPU E5-2650 v2 @ 2.60GHz
stepping : 4
cpu MHz : 1200.000
cache size : 20480 KB
physical id : 0
siblings : 16
core id : 0
cpu cores : 8
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
bogomips : 5200.19
clflush size : 64
cache_alignment : 64
address sizes : 46 bits physical, 48 bits virtual
power management: [8]
其中,processor是逻辑处理器的唯一标识符,vendor-id表⽰处理器类
型,如果为英特尔处理器,则字符串是GenuineIntel。physical id表⽰每个
物理封装的唯一标识符,也就是⼀个物理CPU,siblings表⽰位于相同物理
封装中的逻辑处理器的数量,core id表⽰每个内核的唯⼀标识符,cpu
cores表⽰位于相同物理封装中的内核数量。
在siblings和cpu cores值之间有个对应关系,如果siblings是cpu cores的
两倍,则说明系统⽀持超线程,并且超线程已打开;如果siblings和cpu
cores⼀致,则说明系统不⽀持超线程,或者超线程未打开。
要查看系统物理CPU的个数,可通过如下命令查看。
[root@centos7 ~]#cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc –l
要查看每个物理CPU中内核的个数,可通过如下命令查看。
[root@centos7 ~]#cat /proc/cpuinfo | grep "cpu cores"
要查看系统所有逻辑CPU个数(所有物理CPU中内核的个数加上超线
程个数),可通过如下命令查看。
[root@centos7 ~]#cat /proc/cpuinfo | grep "processor" | wc –l
通过这个简单介绍,根据上⾯的输出可知,此系统有2个物理CPU,每
个物理CPU中有8个内核,并且启⽤了超线程,总共有32个逻辑CPU
3.查看系统内存信息
[root@localhost ~]# more /proc/meminfo
输出结果如下。
MemTotal: 32884072 kB
MemFree: 12939460 kB
Buffers: 834600 kB
Cached: 17634960 kB
SwapCached: 0 kB
Active: 7141568 kB
Inactive: 11833812 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 32884072 kB
LowFree: 12939460 kB
SwapTotal: 32764528 kB
SwapFree: 32764528 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 505560 kB
Mapped: 64480 kB
Slab: 880700 kB
PageTables: 17764 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 49206564 kB
Committed_AS: 900836 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 280536 kB
VmallocChunk: 34359457075 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 2048 kB
根据这个输出,可以很清楚地知道系统的内存占⽤情况。比如,此系
统的物理内存大约为32GB,可以物理内存有大约有13GB,缓冲区占用了
834600kB,缓存占用了17634960kB,等等。
4.查看磁盘分区信息
[root@localhost ~]#fdisk –l