Linux to determine the number of CPU physics, a few cores

Source: Internet
Author: User

1. View the number of physical CPUs
#cat/proc/cpuinfo |grep "Physical id" |sort |uniq|wc-l
2. View the number of logical CPUs
#cat/proc/cpuinfo |grep "Processor" |wc-l
3. View CPU is a few cores
#cat/proc/cpuinfo |grep "cores" |uniq CPU
4. Check the CPU frequency
#cat/proc/cpuinfo |grep Mhz|uniq CPU
# uname-a
(view current operating system kernel information)
# cat/etc/issue
(View current operating system release information)
# Cat/proc/cpuinfo | grep name | Cut-f2-d: | Uniq-c
# getconf Long_bit
32
(indicates that the current CPU is running in 32bit mode, but does not mean that the CPU does not support 64bit)
# Cat/proc/cpuinfo | grep Flags | grep ' LM ' | Wc-l
8
(The result is greater than 0, indicating support for 64bit calculations. LM refers to long mode, which supports LM is 64bit)


How to obtain detailed information about the CPU:
Linux command: Cat/proc/cpuinfo
Use the command to determine several physical CPUs, several cores, etc.:
Number of logical CPUs:
# Cat/proc/cpuinfo | grep "Processor" | Wc-l
Number of physical CPUs:
# Cat/proc/cpuinfo | grep "Physical ID" | Sort | Uniq | Wc-l
Number of cores per physical CPU:
# Cat/proc/cpuinfo | grep "CPU Cores" | Wc-l
Is it hyper-threading?
If there are two logical CPUs with the same "core ID", then Hyper-threading is turned on.
The number of logical CPUs (possibly cores, threads, or both) in each physical CPU: # Cat/proc/cpuinfo | grep "Siblings"

Siblings:8
1. View CPU Information commands
Cat/proc/cpuinfo
2. View memory Information commands
Cat/proc/meminfo
3. View the hard drive information command
Fdisk-l


This article is from the "My Ops Road" blog, so be sure to keep this source http://pythonhome.blog.51cto.com/10015972/1622616

Linux to determine the number of CPU physics, a few cores

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.