Linux查看CPU、机器型号等硬件信息的方法详解

发布时间:2020-04-19编辑:脚本学堂
本文介绍下,在linux系统中,查看cpu信息、机器型号等硬件信息的方法。有需要的朋友,参考下吧。

查看CPU信息(型号)
 

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      8  Intel(R) Xeon(R) CPU            E5410   @ 2.33GHz
(看到有8个逻辑CPU, 也知道了CPU型号)

# cat /proc/cpuinfo | grep physical | uniq -c
      4 physical id      : 0
      4 physical id      : 1
(说明实际上是两颗4核的CPU)
PS:Jay added on 10th, May, 2011
# 其实是可能有超线程HT技术,不一定是有4核,也可能是2核4线程;当时还理解不清楚

# getconf LONG_BIT
   32
(说明当前CPU运行在32bit模式下, 但不代表CPU不支持64bit)

# cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
   8
(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

完整Cpu信息查看:
 

# dmidecode | grep 'Processor Information'

查看内 存信息
 

# cat /proc/meminfo

# uname -a
linux euis1 2.6.9-55.ELsmp #1 SMP Fri Apr 20 17:03:35 EDT 2007 i686 i686 i386 GNU/Linux
(查看当前操作系统内核信息)

# cat /etc/issue | grep Linux
Red Hat Enterprise Linux AS release 4 (Nahant Update 5)
(查看当前操作系统发行版信息)

查看机器型号
# dmidecode | grep "Product Name" 

查看网卡信息
# dmesg | grep -i eth

1 查看CPU
1.1 查看CPU个数
 

# cat /proc/cpuinfo | grep "physical id" | uniq | wc -l
2
**uniq命令:删除重复行;wc –l命令:统计行数**

1.2 查看CPU核数
 

# cat /proc/cpuinfo | grep "cpu cores" | uniq
cpu cores       : 4

1.3 查看CPU型号
 

# cat /proc/cpuinfo | grep 'model name' |uniq
model name      : Intel(R) Xeon(R) CPU           E5630  @ 2.53GHz
 

总结:该服务器有2个4核CPU,型号Intel(R) Xeon(R) CPU E5630 @ 2.53GHz

2 查看内存
2.1 查看内存总数
 

#cat /proc/meminfo | grep MemTotal
MemTotal:     32941268 kB  //内存32G

2.2 查看内存条数
 

# dmidecode |grep -A16 "Memory Device$"
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 2048 MB                 //1条2G内存
        Form Factor: DIMM
        Set: 1
        Locator: DIMM1
        Bank Locator: Not Specified
        Type: DDR2
        Type Detail: Synchronous
        Speed: 667 MHz
        Manufacturer: 7F7F7F7F7F510000
        Serial Number: 0403E324
        Asset Tag: 450721
        Part Number: 72T256220HR3SA  
--
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: 2048 MB                    //1条2G内存
        Form Factor: DIMM
        Set: 1
        Locator: DIMM2
        Bank Locator: Not Specified
        Type: DDR2
        Type Detail: Synchronous
        Speed: 667 MHz
        Manufacturer: 7F7F7F7F7F510000
        Serial Number: 0403E324
        Asset Tag: 450721
        Part Number: 72T256220HR3SA  
--
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: No Module Installed           //1个内存空槽
        Form Factor: DIMM
        Set: 2
        Locator: DIMM3
        Bank Locator: Not Specified
        Type: DDR2
        Type Detail: Synchronous
        Speed: Unknown
        Manufacturer:               
        Serial Number:       
        Asset Tag:     
        Part Number:                 
--
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: No Module Installed               //1个内存空槽
        Form Factor: DIMM
        Set: 2
        Locator: DIMM4
        Bank Locator: Not Specified
        Type: DDR2
        Type Detail: Synchronous
        Speed: Unknown
        Manufacturer:               
        Serial Number:       
        Asset Tag:     
        Part Number:                 
--
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: No Module Installed            //1个内存空槽
        Form Factor: DIMM
        Set: 3
        Locator: DIMM5
        Bank Locator: Not Specified
        Type: DDR2
        Type Detail: Synchronous
        Speed: Unknown
        Manufacturer:               
        Serial Number:       
        Asset Tag:     
        Part Number:                 
--
Memory Device
        Array Handle: 0x1000
        Error Information Handle: Not Provided
        Total Width: 72 bits
        Data Width: 64 bits
        Size: No Module Installed        //1个内存空槽
        Form Factor: DIMM
        Set: 3
        Locator: DIMM6
        Bank Locator: Not Specified
        Type: DDR2
        Type Detail: Synchronous
        Speed: Unknown
        Manufacturer:               
        Serial Number:       
        Asset Tag:     
        Part Number:  
 

总结:该服务器有两条2G内存 ,空余4个插槽

3 查看硬盘
3.1 查看硬盘大小
 

# fdisk -l | grep Disk
Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes
 

总结:硬盘大小146.7G,即厂商标称的160G。

有关linux硬件配置信息的查看方法,就介绍这些吧,看着已是很全面了,希望对大家有所帮助。

您可能感兴趣的文章:
查看linux系统版本信息、磁盘信息、硬件信息的方法
linux下查看硬件信息(CPU、内存、硬盘、主板等信息)
centos中查看服务器硬件信息的命令参考
linux系统硬件配置的查看方法
LINUX查看硬件配置信息的命令大全
Linux下查看硬件信息(CPU、内存、机器型号、网卡等)
Linux下查看硬件信息的几个命令
查看linux中CPU、机器型号等硬件信息的方法
查看Linux硬件信息的方法
查看Linux 硬件配置信息的方法总结
UNIX查看硬件信息的一些方法