查看CPU信息: lscpu

[root@iZcyriae88knxxZ ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                1
On-line CPU(s) list:   0
Thread(s) per core:    1
Core(s) per socket:    1
Socket(s):             1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 85
Model name:            Intel(R) Xeon(R) Platinum 8163 CPU @ 2.50GHz
Stepping:              4
CPU MHz:               2500.004
BogoMIPS:              5000.00
Hypervisor vendor:     KVM
Virtualization type:   full
L1d cache:             32K
L1i cache:             32K
L2 cache:              1024K
L3 cache:              33792K
NUMA node0 CPU(s):     0
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 pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc 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 ibrs ibpb stibp fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat spec_ctrl intel_stibp

CPU

  • 查看CPU核心数执行命令:
lscpu|grep "CPU(s):"
  • 查看CPU核心数也可以通过:
cat /proc/cpuinfo|grep processor

看到的CPU个数确认,如果是4核CPU,则可以看到processor0到processor3共计4个CPU信息

  • 查看CPU型号:
cat /proc/cpuinfo |grep "name" |cut -f2 -d: |uniq -c
  • 查看CPU运行在多少位
 getconf LONG_BIT
  • 按cpu利用率从大到小排序
ps -e -o “%C:%p:%z:%a”|sort -nr