查看“︁Linux:Centos/硬件信息”︁的源代码
来自康健生活
←
Linux:Centos/硬件信息
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
== cpu == 查看CPU的统计信息 <syntaxhighlight lang="bash"> lscpu</syntaxhighlight> <blockquote><pre> Architecture: x86_64 #cpu架构 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 4 #总共有4核 On-line CPU(s) list: 0-3 Thread(s) per core: 1 #每个cpu核,只能支持一个线程,即不支持超线程 Core(s) per socket: 4 #每个cpu,有4个核 Socket(s): 1 #总共有1一个cpu NUMA node(s): 1 Vendor ID: GenuineIntel #cpu产商 intel CPU family: 6 Model: 92 Model name: Intel(R) Celeron(R) CPU J3455 @ 1.50GHz Stepping: 9 CPU MHz: 2195.092 CPU max MHz: 2300.0000 CPU min MHz: 800.0000 BogoMIPS: 2995.20 Virtualization: VT-x #支持cpu虚拟化技术 L1d cache: 24K L1i cache: 32K L2 cache: 1024K NUMA node0 CPU(s): 0-3 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 art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilitiesInsert comment here</pre></blockquote> 查看每个CPU的信息 <syntaxhighlight lang="bash"> cat /proc/cpuinfo</syntaxhighlight> <blockquote><pre> processor : 0 #逻辑处理器的id vendor_id : GenuineIntel cpu family : 6 model : 92 model name : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz stepping : 9 microcode : 0x38 cpu MHz : 2196.597 cache size : 1024 KB physical id : 0 #物理封装的处理器的id siblings : 4 #位于相同物理封装的处理器中的逻辑处理器的数量 core id : 0 #每个核心的id cpu cores : 4 #位于相同物理封装的处理器中的内核数量 apicid : 0 initial apicid : 0 fpu : yes fpu_exception : yes cpuid level : 21 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 art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities bugs : monitor spectre_v1 spectre_v2 bogomips : 2995.20 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 1 vendor_id : GenuineIntel cpu family : 6 model : 92 model name : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz stepping : 9 microcode : 0x38 cpu MHz : 2196.597 cache size : 1024 KB physical id : 0 siblings : 4 core id : 1 cpu cores : 4 apicid : 2 initial apicid : 2 fpu : yes fpu_exception : yes cpuid level : 21 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 art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities bugs : monitor spectre_v1 spectre_v2 bogomips : 2995.20 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 2 vendor_id : GenuineIntel cpu family : 6 model : 92 model name : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz stepping : 9 microcode : 0x38 cpu MHz : 2196.597 cache size : 1024 KB physical id : 0 siblings : 4 core id : 2 cpu cores : 4 apicid : 4 initial apicid : 4 fpu : yes fpu_exception : yes cpuid level : 21 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 art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities bugs : monitor spectre_v1 spectre_v2 bogomips : 2995.20 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management: processor : 3 vendor_id : GenuineIntel cpu family : 6 model : 92 model name : Intel(R) Celeron(R) CPU J3455 @ 1.50GHz stepping : 9 microcode : 0x38 cpu MHz : 2196.073 cache size : 1024 KB physical id : 0 siblings : 4 core id : 3 cpu cores : 4 apicid : 6 initial apicid : 6 fpu : yes fpu_exception : yes cpuid level : 21 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 art arch_perfmon pebs bts rep_good nopl xtopology tsc_reliable nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave rdrand lahf_lm 3dnowprefetch cpuid_fault cat_l2 ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust smep erms mpx rdt_a rdseed smap clflushopt intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves dtherm ida arat pln pts md_clear arch_capabilities bugs : monitor spectre_v1 spectre_v2 bogomips : 2995.20 clflush size : 64 cache_alignment : 64 address sizes : 39 bits physical, 48 bits virtual power management:</pre></blockquote> == 内存 == 内存详细 <syntaxhighlight lang="bash"> cat /proc/meminfo</syntaxhighlight> <blockquote><pre> MemTotal: 7651208 kB #总内存大小 MemFree: 7148956 kB #空闲内存 MemAvailable: 7140896 kB Buffers: 4336 kB #缓冲区大小 Cached: 220196 kB #已经缓存 SwapCached: 0 kB #交换区缓存 Active: 148576 kB #活动大小 Inactive: 162240 kB Active(anon): 87360 kB Inactive(anon): 24572 kB Active(file): 61216 kB Inactive(file): 137668 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 31457276 kB SwapFree: 31457276 kB Dirty: 0 kB Writeback: 0 kB AnonPages: 84284 kB Mapped: 79048 kB Shmem: 25652 kB Slab: 101220 kB SReclaimable: 36984 kB SUnreclaim: 64236 kB KernelStack: 3104 kB PageTables: 6284 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 35282880 kB Committed_AS: 412180 kB VmallocTotal: 34359738367 kB VmallocUsed: 0 kB VmallocChunk: 0 kB HardwareCorrupted: 0 kB AnonHugePages: 16384 kB ShmemHugePages: 0 kB ShmemPmdMapped: 0 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB Hugetlb: 0 kB DirectMap4k: 137516 kB DirectMap2M: 2654208 kB DirectMap1G: 7340032 kB</pre></blockquote> 内存情况 <syntaxhighlight lang="bash"> free -m</syntaxhighlight> <blockquote><pre> total used free shared buff/cache available Mem: 7471 235 6981 25 255 6973 Swap: 30719 0 30719</pre></blockquote> 内存硬件信息 <syntaxhighlight lang="bash"> dmidecode -t memory</syntaxhighlight> <blockquote><pre> # dmidecode 3.2 Getting SMBIOS data from sysfs. SMBIOS 3.0.0 present. Handle 0x000E, DMI type 16, 23 bytes Physical Memory Array Location: System Board Or Motherboard Use: System Memory Error Correction Type: None Maximum Capacity: 16 GB Error Information Handle: Not Provided Number Of Devices: 2 Handle 0x000F, DMI type 17, 40 bytes Memory Device Array Handle: 0x000E Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 4096 MB Form Factor: SODIMM Set: None Locator: ChannelA-DIMM0 Bank Locator: BANK 0 Type: DDR3 Type Detail: Synchronous Speed: 1600 MT/s Manufacturer: Kingston Serial Number: F01E3A7B Asset Tag: 9876543210 Part Number: 9905417-082.A00G Rank: 1 Configured Memory Speed: 1600 MT/s Minimum Voltage: 1.35 V Maximum Voltage: 1.5 V Configured Voltage: 1.5 V Handle 0x0010, DMI type 17, 40 bytes Memory Device Array Handle: 0x000E Error Information Handle: Not Provided Total Width: 64 bits Data Width: 64 bits Size: 4096 MB Form Factor: SODIMM Set: None Locator: ChannelA-DIMM1 Bank Locator: BANK 1 Type: DDR3 Type Detail: Synchronous Speed: 1600 MT/s Manufacturer: Samsung Serial Number: 38C5076C Asset Tag: 9876543210 Part Number: M471B5173DX0-YK0 Rank: 1 Configured Memory Speed: 1600 MT/s Minimum Voltage: 1.35 V Maximum Voltage: 1.5 V Configured Voltage: 1.5 V</pre></blockquote> == 硬盘 == 硬盘和分区分布 <syntaxhighlight lang="bash"> lsblk</syntaxhighlight> <blockquote><pre> NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 447.1G 0 disk ├─sda1 8:1 0 200G 0 part /home └─sda2 8:2 0 150G 0 part /var sdb 8:16 0 111.8G 0 disk ├─sdb1 8:17 0 2M 0 part ├─sdb2 8:18 0 2M 0 part ├─sdb3 8:19 0 1G 0 part /boot ├─sdb4 8:20 0 1K 0 part ├─sdb5 8:21 0 30G 0 part [SWAP] ├─sdb6 8:22 0 30G 0 part / ├─sdb7 8:23 0 10G 0 part /usr ├─sdb8 8:24 0 5G 0 part /usr/local └─sdb9 8:25 0 2G 0 part /tmp</pre></blockquote> 硬盘和分区的详细信息 <syntaxhighlight lang="bash"> fdisk -l</syntaxhighlight> <blockquote><pre> Disk /dev/sdb: 111.8 GiB, 120034123776 bytes, 234441648 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0x6a1ff51c Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 6143 4096 2M 83 Linux /dev/sdb2 6144 10239 4096 2M 83 Linux /dev/sdb3 * 10240 2107391 2097152 1G 83 Linux /dev/sdb4 2107392 234440703 232333312 110.8G 5 Extended /dev/sdb5 2111488 65026047 62914560 30G 82 Linux swap / Solaris /dev/sdb6 65028096 127942655 62914560 30G 83 Linux /dev/sdb7 127944704 148916223 20971520 10G 83 Linux /dev/sdb8 148918272 159404031 10485760 5G 83 Linux /dev/sdb9 159406080 163600383 4194304 2G 83 Linux Disk /dev/sda: 447.1 GiB, 480103981056 bytes, 937703088 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disklabel type: dos Disk identifier: 0xbde80fca Device Boot Start End Sectors Size Id Type /dev/sda1 2048 419432447 419430400 200G 83 Linux /dev/sda2 419432448 734005247 314572800 150G 83 Linux</pre></blockquote> == 声卡、显卡 == <syntaxhighlight lang="bash"> lspci |grep -i 'VGA' </syntaxhighlight> <blockquote><pre> 00:02.0 VGA compatible controller: Intel Corporation Device 5a85 (rev 0b)</pre></blockquote> <syntaxhighlight lang="bash"> dmesg | grep -i 'VGA'</syntaxhighlight> <blockquote><pre> [ 0.000000] Console: colour VGA+ 80x25 [ 0.250081] pci 0000:00:02.0: vgaarb: setting as boot VGA device [ 0.250081] pci 0000:00:02.0: vgaarb: VGA device added: decodes=io+mem,owns=io+mem,locks=none [ 0.250081] pci 0000:00:02.0: vgaarb: bridge control possible [ 0.250081] vgaarb: loaded [ 2.104876] [drm] Replacing VGA console driver [ 2.107265] i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=io+mem:owns=io+mem</pre></blockquote> == 网卡 == <syntaxhighlight lang="shell"> lspci | grep -i 'eth'</syntaxhighlight> <blockquote><pre> 01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 11)</pre></blockquote> == 进程 == <syntaxhighlight lang="bash"> top</syntaxhighlight> <blockquote> 第一行,任务队列信息,同 uptime 命令的执行结果,具体参数说明情况如下: 14:06:23 — 当前系统时间 up 70 days, 16:44 — 系统已经运行了70天16小时44分钟(在这期间系统没有重启过的吆!) 2 users — 当前有2个用户登录系统 load average: 1.15, 1.42, 1.44 — load average后面的三个数分别是1分钟、5分钟、15分钟的负载情况。 load average数据是每隔5秒钟检查一次活跃的进程数,然后按特定算法计算出的数值。如果这个数除以逻辑CPU的数量,结果高于5的时候就表明系统在超负荷运转了 第二行,Tasks — 任务(进程),具体信息说明如下: 系统现在共有206个进程,其中处于运行中的有1个,205个在休眠(sleep),stoped状态的有0个,zombie状态(僵尸)的有0个。 第三行,cpu状态信息,具体属性说明如下: 5.9%us — 用户空间占用CPU的百分比。 3.4% sy — 内核空间占用CPU的百分比。 0.0% ni — 改变过优先级的进程占用CPU的百分比 90.4% id — 空闲CPU百分比 0.0% wa — IO等待占用CPU的百分比 0.0% hi — 硬中断(Hardware IRQ)占用CPU的百分比 0.2% si — 软中断(Software Interrupts)占用CPU的百分比 第四行,内存状态,具体信息如下: 32949016k total — 物理内存总量(32GB) 14411180k used — 使用中的内存总量(14GB) 18537836k free — 空闲内存总量(18GB) 169884k buffers — 缓存的内存量 (169M) 第五行,swap交换分区信息,具体信息说明如下: 32764556k total — 交换区总量(32GB) 0k used — 使用的交换区总量(0K) 32764556k free — 空闲交换区总量(32GB) 3612636k cached — 缓冲的交换区总量(3.6GB) 第六行以下:各进程(任务)的状态监控,项目列信息说明如下: PID — 进程id USER — 进程所有者 PR — 进程优先级 NI — nice值。负值表示高优先级,正值表示低优先级 VIRT — 进程使用的虚拟内存总量,单位kb。VIRT=SWAP+RES RES — 进程使用的、未被换出的物理内存大小,单位kb。RES=CODE+DATA SHR — 共享内存大小,单位kb S — 进程状态。D=不可中断的睡眠状态 R=运行 S=睡眠 T=跟踪/停止 Z=僵尸进程 %CPU — 上次更新到现在的CPU时间占用百分比 %MEM — 进程使用的物理内存百分比 TIME+ — 进程使用的CPU时间总计,单位1/100秒 COMMAND — 进程名称(命令名/命令行) </blockquote> == 其他 == <syntaxhighlight lang="bash"> # uname -a 查看内核/操作系统/CPU信息 # head -n 1 /etc/issue 查看操作系统版本 # cat /proc/cpuinfo 查看CPU信息 # hostname 查看计算机名 # lspci -tv 列出所有PCI设备 # lsusb -tv 列出所有USB设备 # lsmod 列出加载的内核模块 # env 查看环境变量 # swapon -s 查看所有交换分区 # df 查看文件系统的磁盘使用情况统计</syntaxhighlight>
返回
Linux:Centos/硬件信息
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。