转 操作系统常用命令
|-转 常用的Linux下查看服务器配置的命令
https://blog.csdn.net/u011636440/article/details/78611838
chestnut2019 最后发布于2017-11-23 10:55:52 阅读数 39013 收藏
展开
服务器型号
[root@k80 ~]# dmidecode|grep "System Information" -A9|egrep "Manufacturer|Product"
Manufacturer: Sugon
Product Name: W580-G20
操作系统
查看当前操作系统发行版信息
[root@k80 ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
查看操作系统发行版详细信息
[root@k80 ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core
CPU
查看CPU统计信息
[root@k80 ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 12
On-line CPU(s) list: 0-11
Thread(s) per core: 1
Core(s) per socket: 6
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 63
Model name: Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz
Stepping: 2
CPU MHz: 1780.062
BogoMIPS: 3805.02
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 15360K
NUMA node0 CPU(s): 0-5
NUMA node1 CPU(s): 6-11
查看CPU型号
[root@k80 ~]# cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
12 Intel(R) Xeon(R) CPU E5-2609 v3 @ 1.90GHz
查看物理CPU个数
[root@k80 ~]# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
2
查看每个物理CPU中core的个数(即核数)
[root@k80 ~]# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 6
查看逻辑CPU的个数
[root@k80 ~]# cat /proc/cpuinfo| grep "processor"| wc -l
12
内存
查看概要内存使用情况
[root@k80 ~]# free -g
total used free shared buff/cache available
Mem: 62 8 35 2 18 51
Swap: 31 0 31
-g是以GB为单位;也可以使用-m,即以MB为单位
查看内存硬件信息
[root@k80 ~]# dmidecode -t memory
# dmidecode 3.0
Scanning /dev/mem for entry point.
SMBIOS 3.0 present.
Handle 0x002B, DMI type 16, 23 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: Multi-bit ECC
Maximum Capacity: 256 GB
Error Information Handle: Not Provided
Number Of Devices: 4
Handle 0x002C, DMI type 17, 40 bytes
Memory Device
Array Handle: 0x002B
Error Information Handle: Not Provided
Total Width: 72 bits
Data Width: 64 bits
Size: 32 GB
Form Factor: DIMM
Set: None
Locator: P1-DIMMA1
Bank Locator: P0_Node0_Channel0_Dimm0
Type: DDR4
Type Detail: Synchronous
Speed: 2400 MHz
Manufacturer: Samsung
Serial Number: 35A24C2F
Asset Tag: P1-DIMMA1_AssetTag (date:17/19)
Part Number: M393A4K40BB1-CRC
Rank: 2
Configured Clock Speed: 1600 MHz
Minimum Voltage: Unknown
Maximum Voltage: Unknown
Configured Voltage: Unknown
……
查看内存详细使用情况
[root@k80 ~]# cat /proc/meminfo
MemTotal: 65683572 kB
MemFree: 35808252 kB
MemAvailable: 52288668 kB
Buffers: 1020 kB
Cached: 18199556 kB
SwapCached: 0 kB
Active: 20343632 kB
Inactive: 7164792 kB
Active(anon): 9343616 kB
Inactive(anon): 2116004 kB
Active(file): 11000016 kB
Inactive(file): 5048788 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 32964604 kB
SwapFree: 32964604 kB
Dirty: 1384 kB
……
查看内存的插槽数,已经使用多少插槽.每条内存多大
[root@k80 ~]# dmidecode|grep -A5 "Memory Device"|grep Size|grep -v Range
Size: 32 GB
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed
Size: No Module Installed...