Linux _ view the number of CPUs, cores, and threads of the system
(1) view cpu Information
[Root @ xckydb ~] # Cat/proc/cpuinfo
-- View cpu Information
Processor: 0
Vendor_id: GenuineIntel
Cpu family: 6
Model: 58
Model name: Intel (R) Core (TM) i5-3320M CPU @ 2.60 GHz
Stepping: 9
Cpu MHz: 2566.490
Cache size: 6144 KB
Fpu: yes
Fpu_exception: yes
Cpuid level: 5
Wp: yes
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat limit 36 clflush mmx fxsr sse sse2 syscall nx rdtscp lm constant_tsc up pni monitor ssse3 lahf_lm
Bogomips: 5132.98
Clflush size: 64
Cache_alignment: 64
Address sizes: 36 bits physical, 48 bits virtual
Power management:
(2) view cpu brief information
[Root @ xckydb ~] # Cat/proc/cpuinfo | grep name | cut-f2-d: | uniq-c
-- View brief cpu Information
1 Intel (R) Core (TM) i5-3320M CPU @ 2.60 GHz
(3) Check the number of physical CPUs
[Root @ xckydb ~] # Grep 'physical id'/proc/cpuinfo | sort-u
1
-- The number of physical CPUs is 1.
(4) Check the number of cores
[Root @ xckydb ~] # Grep 'core id'/proc/cpuinfo | sort-u | wc-l
6
-- Check that the number of CPU cores is 6
(5) view the number of threads
[Root @ xckydb ~] # Grep 'processor '/proc/cpuinfo | sort-u | wc-l
12
-- Check that the total number of cpu threads is 12 (6 cores)