Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux to view the number of physical CPU, core, and logical CPU

Shulou Source: shulou.com Published: 2022-06-02 05:03:49 10月29日 Update

Total number of cores = number of physical CPU X number of cores per physical CPU

Total logical CPU = number of physical CPU X number of cores per physical CPU X number of super threads

# check the number of physical CPU

Cat / proc/cpuinfo | grep "physical id" | sort | uniq | wc-l

# check the number of core in each physical CPU (i.e. the number of cores)

Cat / proc/cpuinfo | grep "cpu cores" | uniq

# check the number of logical CPU

Cat / proc/cpuinfo | grep "processor" | wc-l

# View CPU information (model)

Cat / proc/cpuinfo | grep name | cut-f2-d: | uniq-c

# View memory information

Cat / proc/meminfo

Tags: Physics number core logic information model thread Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Xiaomi macOS OPPO Reno NVidia