Many laptops or desktops are installed with Ubuntu or other Linux operating systems.
In Windows, you can easily and quickly see the current CPU information. How can we quickly know it in Linux ?!
It is also very simple. If you don't believe it, you can try the following command:
Lscpu
We can see that the CPU information is displayed, and the red part is the number of digits of the CPU and the number of cores of the CPU.
In fact, the following command will show more details:
Cat-N/proc/cpuinfo
However, the content is too large, and it looks hard. Below are several common commands.
A. view the number of physical CPUs
CAT/proc/cpuinfo | grep "physical ID" | sort | uniq | WC-l
Note: Physical CPUs are real hardware.
B. view the number of logical CPUs
CAT/proc/cpuinfo | grep "processor" | WC-l
C. Check the CPU Cores
CAT/proc/cpuinfo | grep "cores" | uniq
D. view the CPU clock speed
CAT/proc/cpuinfo | grep MHz | uniq
Shows the query result:
Of course, different CPU display results will be different.
WC is mainly used for statistics.
See http://www.cnblogs.com/czai/archive/2011/12/09/2282405.html
Uniq is used to show only the same data in repeated rows.
See http://www.ibm.com/developerworks/cn/linux/l-tip-prompt/l-tiptex6/