Linux系统查看服务器型号、CPU、RAM、ROM以及网卡信息

来源:互联网 发布:sql查询不重复的记录 编辑:程序博客网 时间:2024/06/04 19:50

首先是CPU方面的:
查看CPU型号

# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c      8  Intel(R) Xeon(R) CPU E5-2609 v2 @ 2.50GHz

查看物理CPU个数

# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l2

查看CPU核心数

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

查看逻辑CPU个数

# cat /proc/cpuinfo| grep "processor"| wc -l8

查看服务器型号
方法一

# grep 'DMI' /var/log/dmesgDMI: Dell Inc. PowerEdge R720/******, BIOS 2.4.3 07/09/2014

方法二

# yum -y install dmidecodeLoaded plugins: fastestmirror, refresh-packagekitSetting up Install ProcessLoading mirror speeds from cached hostfile * base: mirrors.sohu.com * epel: mirrors.sohu.com * extras: mirrors.aliyun.com * linuxtech-release: linuxsoft.cern.ch * remi-safe: mirror.innosol.asia * updates: mirrors.sohu.comPackage 1:dmidecode-2.12-7.el6.x86_64 already installed and latest versionNothing to do# dmidecode |grep -A4 'System Information'System Information    Manufacturer: Dell Inc.    Product Name: PowerEdge R720    Version: Not Specified    Serial Number: *******

查看是32位还是64位系统

# uname -aLinux **** 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

查看RAM
方法一

# cat /proc/meminfoMemTotal:       32826948 kBMemFree:        30190792 kBBuffers:          161544 kBCached:          1476004 kBSwapCached:            0 kBActive:          1377540 kBInactive:         814108 kBActive(anon):     554320 kBInactive(anon):    20080 kBActive(file):     823220 kBInactive(file):   794028 kBUnevictable:           0 kBMlocked:               0 kBSwapTotal:      16482300 kBSwapFree:       16482300 kBDirty:              5112 kBWriteback:             0 kBAnonPages:        553972 kBMapped:           129264 kBShmem:             20308 kBSlab:             185168 kBSReclaimable:     103320 kBSUnreclaim:        81848 kBKernelStack:        7968 kBPageTables:        19384 kBNFS_Unstable:          0 kBBounce:                0 kBWritebackTmp:          0 kBCommitLimit:    32895772 kBCommitted_AS:    2453404 kBVmallocTotal:   34359738367 kBVmallocUsed:      339064 kBVmallocChunk:   34342499988 kBHardwareCorrupted:     0 kBAnonHugePages:    280576 kBHugePages_Total:       0HugePages_Free:        0HugePages_Rsvd:        0HugePages_Surp:        0Hugepagesize:       2048 kBDirectMap4k:        5056 kBDirectMap2M:     2045952 kBDirectMap1G:    31457280 kB

方法二 (还查看到了swap分区的大小)

# free -m             total       used       free     shared    buffers     cachedMem:         32057       2573      29484         19        157       1442-/+ buffers/cache:        973      31084Swap:        16095          0      16095

查看ROM
方法一

# cat /proc/partitions major minor  #blocks  name   7        0    2168646 loop0   7        1    3824640 loop1   8        0  975699968 sda   8        1     512000 sda1   8        2  975186944 sda2 253        0   52428800 dm-0 253        1   16482304 dm-1 253        2  906272768 dm-2

方法二

# fdisk -lDisk /dev/loop0: 2220 MB, 2220693504 bytes255 heads, 63 sectors/track, 269 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/loop1: 3916 MB, 3916431360 bytes64 heads, 32 sectors/track, 3735 cylindersUnits = cylinders of 2048 * 512 = 1048576 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x47840dcd      Device Boot      Start         End      Blocks   Id  System/dev/loop1p1   *           1        3735     3824640   17  Hidden HPFS/NTFSDisk /dev/sda: 999.1 GB, 999116767232 bytes255 heads, 63 sectors/track, 121469 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0004e250   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *           1          64      512000   83  LinuxPartition 1 does not end on cylinder boundary./dev/sda2              64      121470   975186944   8e  Linux LVM

查看网卡信息

# ip a结果略....
阅读全文
1 0
原创粉丝点击