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

首先是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 -l
2

查看CPU核心数
# cat /proc/cpuinfo| grep “cpu cores”| uniq
cpu cores : 4

查看逻辑CPU个数
# cat /proc/cpuinfo| grep “processor”| wc -l
8

查看服务器型号
方法一
# grep ‘DMI’ /var/log/dmesg
DMI: Dell Inc. PowerEdge R720/******, BIOS 2.4.3 07/09/2014

方法二
# yum -y install dmidecode
Loaded plugins: fastestmirror, refresh-packagekit
Setting up Install Process
Loading 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.com
Package 1:dmidecode-2.12-7.el6.x86_64 already installed and latest version
Nothing to do

# dmidecode |grep -A4 ‘System Information’
System Information
Manufacturer: Dell Inc.
Product Name: PowerEdge R720
Version: Not Specified
Serial Number: *******
查看是32位还是64位系统

# uname -a
Linux **** 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/meminfo
MemTotal: 32826948 kB
MemFree: 30190792 kB
Buffers: 161544 kB
Cached: 1476004 kB
SwapCached: 0 kB
Active: 1377540 kB
Inactive: 814108 kB
Active(anon): 554320 kB
Inactive(anon): 20080 kB
Active(file): 823220 kB
Inactive(file): 794028 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 16482300 kB
SwapFree: 16482300 kB
Dirty: 5112 kB
Writeback: 0 kB
AnonPages: 553972 kB
Mapped: 129264 kB
Shmem: 20308 kB
Slab: 185168 kB
SReclaimable: 103320 kB
SUnreclaim: 81848 kB
KernelStack: 7968 kB
PageTables: 19384 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 32895772 kB
Committed_AS: 2453404 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 339064 kB
VmallocChunk: 34342499988 kB
HardwareCorrupted: 0 kB
AnonHugePages: 280576 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

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

# free -m
total used free shared buffers cached
Mem: 32057 2573 29484 19 157 1442
-/+ buffers/cache: 973 31084
Swap: 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 -l

Disk /dev/loop0: 2220 MB, 2220693504 bytes
255 heads, 63 sectors/track, 269 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/loop1: 3916 MB, 3916431360 bytes
64 heads, 32 sectors/track, 3735 cylinders
Units = cylinders of 2048 * 512 = 1048576 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x47840dcd

Device Boot Start End Blocks Id System
/dev/loop1p1 * 1 3735 3824640 17 Hidden HPFS/NTFS

Disk /dev/sda: 999.1 GB, 999116767232 bytes
255 heads, 63 sectors/track, 121469 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0004e250

Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 121470 975186944 8e Linux LVM

查看网卡信息

# ip a
结果略….

原创文章,作者:赛福,如若转载,请注明出处:https://www.safecdn.cn/linux/2020/03/linux-cpu-ram-rom.html

发表评论

邮箱地址不会被公开。