Linux下查看机器型号
# dmidecode | grep "Product Name"
Product Name: VMware Virtual Platform
Product Name: 440BX Desktop Reference Platform
Linux下查看OS信息
---Linux查看版本当前操作系统内核信息
# uname -a
Linux RUISTUDY 3.10.0-862.el7.x86_64 #1 SMP Fri Apr 20 16:44:24 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
---Linux查看当前操作系统版本信息
# cat /proc/version
Linux version 3.10.0-862.el7.x86_64 (builder@) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-28) (GCC) ) #1 SMP Fri Apr 20 16:44:24 UTC 2018
---Linux查看版本当前操作系统发行版信息
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.7 (Maipo)
# cat /etc/os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.7 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.7"
PRETTY_NAME="Red Hat Enterprise Linux Server 7.7 (Maipo)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.7:GA:server"
HOME_URL="/"
BUG_REPORT_URL="/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.7
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.7"
Linux下查看 CPU 信息
---Linux查看版本说明当前CPU运行在 64bit 模式下
# getconf LONG_BIT
64
---查看物理CPU个数
# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
8
---查看每个物理CPU中core的个数(即核数)
# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores : 1
---查看逻辑CPU的个数
# cat /proc/cpuinfo| grep "processor"| wc -l
8
---查看逻辑CPU个数及CPU型号
#cat /proc/cpuinfo | grep name | cut -f2 -d: | uniq -c
8 Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
Linux下查看 CPU 详细信息
---说明实际上是8颗1核的CPU
# 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 : 2
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 3
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 4
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 5
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 6
1 address sizes : 46 bits physical, 48 bits virtual
1 physical id : 7
1 address sizes : 46 bits physical, 48 bits virtual
---Linux查看cpu相关信息,包括型号、主频、内核信息等
# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 0
siblings : 1
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 1
siblings : 1
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 2
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 2
siblings : 1
core id : 0
cpu cores : 1
apicid : 2
initial apicid : 2
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 3
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 3
siblings : 1
core id : 0
cpu cores : 1
apicid : 3
initial apicid : 3
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 4
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 4
siblings : 1
core id : 0
cpu cores : 1
apicid : 4
initial apicid : 4
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 5
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 5
siblings : 1
core id : 0
cpu cores : 1
apicid : 5
initial apicid : 5
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 6
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 6
siblings : 1
core id : 0
cpu cores : 1
apicid : 6
initial apicid : 6
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
processor : 7
vendor_id : GenuineIntel
cpu family : 15
model : 6
model name : Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
stepping : 1
microcode : 0x1
cpu MHz : 2294.608
cache size : 16384 KB
physical id : 7
siblings : 1
core id : 0
cpu cores : 1
apicid : 7
initial apicid : 7
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 syscall nx pdpe1gb rdtscp lm constant_tsc 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 ssbd ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap clflushopt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat md_clear spec_ctrl intel_stibp
bogomips : 4589.21
clflush size : 64
cache_alignment : 128
address sizes : 46 bits physical, 48 bits virtual
power management:
Linux下查看内存信息
# cat /proc/meminfo
MemTotal: 8010176 kB
MemFree: 350500 kB
MemAvailable: 5168080 kB
Buffers: 32 kB
Cached: 6954164 kB
SwapCached: 1972 kB
Active: 4462780 kB
Inactive: 2735848 kB
Active(anon): 1949692 kB
Inactive(anon): 317468 kB
Active(file): 2513088 kB
Inactive(file): 2418380 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 8257532 kB
SwapFree: 8218108 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 242636 kB
Mapped: 1732900 kB
Shmem: 2022728 kB
Slab: 250296 kB
SReclaimable: 192036 kB
SUnreclaim: 58260 kB
KernelStack: 3664 kB
PageTables: 95236 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 12262620 kB
Committed_AS: 2728012 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 169168 kB
VmallocChunk: 34359341052 kB
HardwareCorrupted: 0 kB
AnonHugePages: 10240 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
DirectMap4k: 118656 kB
DirectMap2M: 8269824 kB
Linux下查看网卡信息
# dmesg | grep -i eth
# dmesg | grep -i eth
[1.583208] vmxnet3 0000:0b:00.0 eth0: NIC Link is Up 10000 Mbps
Linux下查看 CPU 使用情况
# top
top - 21:39:13 up 56 days, 2:48, 2 users, load average: 0.01, 0.02, 0.05
Tasks: 305 total, 1 running, 304 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.1 us, 0.1 sy, 0.0 ni, 99.8 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 32780016 total, 255448 free, 932860 used, 31591708 buff/cache
KiB Swap: 20967420 total, 20962556 free, 4864 used. 22449000 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
11642 oracle -2 0 9974.8m 16868 14820 S 2.3 0.1 1484:36 ora_vktm_study
1840 root 20 0 0 0 0 S 0.3 0.0 27:47.02 xfsaild/dm-3
11679 oracle 20 0 9.8g 319152 301604 S 0.3 1.0 48:15.11 ora_mmon_study18230 root 20 0 162152 2440 1572 R 0.3 0.0 0:00.11 top
1 root 20 0 46184 6592 3996 S 0.0 0.0 23:46.00 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:01.70 kthreadd
4 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
6 root 20 0 0 0 0 S 0.0 0.0 0:09.07 ksoftirqd/0
7 root rt 0 0 0 0 S 0.0 0.0 0:00.82 migration/0
8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
9 root 20 0 0 0 0 S 0.0 0.0 43:30.71 rcu_sched
10 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 lru-add-drain
11 root rt 0 0 0 0 S 0.0 0.0 0:23.91 watchdog/0
12 root rt 0 0 0 0 S 0.0 0.0 0:22.11 watchdog/1
13 root rt 0 0 0 0 S 0.0 0.0 0:01.04 migration/1
14 root 20 0 0 0 0 S 0.0 0.0 0:11.17 ksoftirqd/1
16 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H
17 root rt 0 0 0 0 S 0.0 0.0 0:24.95 watchdog/2
18 root rt 0 0 0 0 S 0.0 0.0 0:01.82 migration/2
19 root 20 0 0 0 0 S 0.0 0.0 0:18.43 ksoftirqd/2
21 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0H
22 root rt 0 0 0 0 S 0.0 0.0 0:26.71 watchdog/3
23 root rt 0 0 0 0 S 0.0 0.0 0:02.01 migration/3
24 root 20 0 0 0 0 S 0.0 0.0 0:15.58 ksoftirqd/3
Linux下查看内存使用情况
# free -g
total used free shared buff/cache available
Mem: 31 0 0 8 30 21
Swap: 19 0 19