Linux下查看CPU信息、机器型号等硬件信息

查看CPU信息(型号)

[file@dell ~]$ cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
      8  Intel(R) Xeon(R) CPU E5-2609 0 @ 2.40GHz

(看到有8个逻辑CPU, 也知道了CPU型号)

[file@dell ~]$ cat /proc/cpuinfo | grep physical | uniq -c
      1 physical id     : 0
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 1
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 0
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 1
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 0
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 1
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 0
      1 address sizes   : 46 bits physical, 48 bits virtual
      1 physical id     : 1
      1 address sizes   : 46 bits physical, 48 bits virtual

查看系统是32位还是64位

[file@dell ~]$ getconf LONG_BIT
64

(说明当前CPU运行在64bit模式下)

[file@dell ~]$ cat /proc/cpuinfo | grep flags | grep ' lm ' | wc -l
8

(结果大于0, 说明支持64bit计算. lm指long mode, 支持lm则是64bit)

 

使用uname查看

[root@intimeam webserver]# uname -a
Linux intimeam 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux

or

[file@dell ~]$ uname -a
Linux dell.product.1 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

查看内存信息

[file@dell ~]$ cat /proc/meminfo
MemTotal:       32832632 kB
MemFree:          218412 kB
Buffers:          361224 kB
Cached:         29730616 kB
SwapCached:       193732 kB
Active:         19432752 kB
Inactive:       11796784 kB
Active(anon):    7629320 kB
Inactive(anon):   759048 kB
Active(file):   11803432 kB
Inactive(file): 11037736 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:      83886072 kB
SwapFree:       82672268 kB
Dirty:               252 kB
Writeback:             4 kB
AnonPages:        948744 kB
Mapped:          5956452 kB
Shmem:           7250672 kB
Slab:             651876 kB
SReclaimable:     588616 kB
SUnreclaim:        63260 kB
KernelStack:        6248 kB
PageTables:       289524 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:    100302388 kB
Committed_AS:   10656796 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      350400 kB
VmallocChunk:   34342238608 kB
HardwareCorrupted:     0 kB
AnonHugePages:    534528 kB
HugePages_Total:       0
HugePages_Free:        0
HugePages_Rsvd:        0
HugePages_Surp:        0
Hugepagesize:       2048 kB
DirectMap4k:        5056 kB
DirectMap2M:     2045952 kB
DirectMap1G:    31457280 kB

查看当前操作系统发行版信息

[file@dell ~]$ cat /etc/issue
CentOS release 6.3 (Final)
Kernel \r on an \m

查看机器型号(需要root权限)

[root@intimeam webserver]# dmidecode | grep "Product Name"
        Product Name: VMware Virtual Platform
        Product Name: 440BX Desktop Reference Platform

查看网卡信息

[webserver@intimeam ~]$ dmesg | grep -i eth
eth0: registered as PCnet/PCI II 79C970A
eth0: link up
eth0: no IPv6 routers present

 

posted @ 2014-03-11 15:48  INTIME-DEV  阅读(15615)  评论(0编辑  收藏  举报