https://blog.csdn.net/weixin_32626635/article/details/116804770
一、查看系统版本信息
(1)查看系统详细信息
使用uname -a命令,可以查看系统版本的详细信息,如下所示:Linux gwmaster 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
(2)查看当前运行的系统信息
使用cat /proc/version命令Linux version 3.10.0-514.26.2.el7.x86_64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Tue Jul 4 15:04:05 UTC 2017
(3)查看发行版本
使用cat /etc/issue或cat /etc/redhat-release命令CentOS Linux release 7.2.1511 (Core)
(4)查看发行详细信息
使用lsb_release -a命令,如果提示找不到命令lsb_release,则需要手动使用命令yum install redhat-lsb -y安装相应的软件包LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
二、查看系统位数
(1)使用命令uname -aLinux gwmaster 3.10.0-514.26.2.el7.x86_64 #1 SMP Tue Jul 4 15:04:05 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
(2)使用命令file /bin/ls/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=aa7ff68f13de25936a098016243ce57c3c982e06, stripped
(3)使用命令archx86_64
三、查看CPU信息
(1)查看cpu详细信息
使用cat /proc/cpuinfo命令processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-26xx v4
stepping : 1
microcode : 0x1
cpu MHz : 2399.998
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch bmi1 avx2 bmi2 rdseed adx xsaveopt
bogomips : 4799.99
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-26xx v4
stepping : 1
microcode : 0x1
cpu MHz : 2399.998
cache size : 4096 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 1
apicid : 1
initial apicid : 1
fpu : yes
fpu_exception : yes
cpuid level : 13
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch bmi1 avx2 bmi2 rdseed adx xsaveopt
bogomips : 4799.99
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management:
(2)查看物理CPU的个数
使用cat /proc/cpuinfo| grep “physical id”| sort| uniq| wc -l命令1
(3)查看逻辑CPU的个数
使用cat /proc/cpuinfo| grep “processor”| wc -l命令2
(4)查看CPU的核心数
使用cat /proc/cpuinfo| grep “cpu cores”| uniq命令cpu cores : 1
四、查看内存信息
(1)查看物理内存信息
使用cat /proc/meminfo命令MemTotal: 3882032 kB
MemFree: 258428 kB
MemAvailable: 1313820 kB
Buffers: 80688 kB
Cached: 1079108 kB
SwapCached: 0 kB
Active: 2790424 kB
Inactive: 563724 kB
Active(anon): 2194812 kB
Inactive(anon): 32 kB
Active(file): 595612 kB
Inactive(file): 563692 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 0 kB
SwapFree: 0 kB
Dirty: 664 kB
Writeback: 0 kB
AnonPages: 2194328 kB
Mapped: 43592 kB
Shmem: 492 kB
Slab: 202988 kB
SReclaimable: 183264 kB
SUnreclaim: 19724 kB
KernelStack: 11648 kB
PageTables: 12148 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 1941016 kB
Committed_AS: 4260100 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 14000 kB
VmallocChunk: 34359715580 kB
HardwareCorrupted: 0 kB
AnonHugePages: 1837056 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 38904 kB
DirectMap2M: 4155392 kB
(2)查看内存实际使用情况
使用命令free -m命令total used free shared buff/cache available
Mem: 3791 2207 252 0 1330 1283
Swap: 0 0 0
五、查看硬盘信息
(1)使用cat /proc/partitions命令major minor #blocks name
253 0 52428800 vda
253 1 52427776 vda1
(2)使用df -lh命令文件系统 容量 已用 可用 已用% 挂载点
/dev/vda1 50G 6.8G 40G 15% /
devtmpfs 1.9G 0 1.9G 0% /dev
tmpfs 1.9G 24K 1.9G 1% /dev/shm
tmpfs 1.9G 460K 1.9G 1% /run
tmpfs 1.9G 0 1.9G 0% /sys/fs/cgroup
tmpfs 380M 0 380M 0% /run/user/0
tmpfs 380M 0 380M 0% /run/user/1000