Common Linux commands: View CPU Information

Source: Internet
Author: User

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/





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.