Q. How do I display CPU information such as the number of CPUs and their speed?
A. Proc (/proc) file system provides easy information about CPU and their speed.
The proc filesystem is a pseudo-filesystem which is used as an interface to kernel data structures. It is commonly mounted at /proc. Most of it is read-only, but some files allow kernel variables to be changed.
Display the number of processors in Linux
You need to use /proc/cpuinfo file. This is a collection of CPU and system architecture dependent items, for each supported architecture a different list. Two common entries are processor which gives CPU number and bogomips; a system constant that is calculated during kernel initialization. SMP machines have information for each CPU. Type the following command:
$ less /proc/cpuinfo
Output:
processor : 0 vendor_id : GenuineIntel cpu family : 15 model : 4 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 3 cpu MHz : 2992.991 cache size : 2048 KB physical id : 0 siblings : 2 fdiv_bug : no hlt_bug : no f00f_bug : no coma_bug : no 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 pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm pni monitor ds_cpl cid bogomips : 5931.00 processor : 1 vendor_id : GenuineIntel cpu family : 15 model : 4 model name : Intel(R) Xeon(TM) CPU 3.00GHz stepping : 3 cpu MHz : 2992.991 cache size : 2048 KB physical id : 0 siblings : 2 ..... ... ....
You can narrow down output with the following command, to display number of processors in the system:
$ grep processor /proc/cpuinfo
See also:
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- My 10 UNIX Command Line Mistakes
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
- Email FAQ to a friend
- Download PDF version
- Printable version
- Comment RSS feed
- Last Updated: 08/24/07



{ 4 comments… read them below or add one }
thanks, works
this works, but you have to pay attention, cause not every time it shows correct info. For example i have 2x intel xeon quad core. cpuinfo shows 16 processors???!!
you have 16 virtual processors total…that is correct
2 quads but each of the these physical processors implement hyperthreading
2 x (4×2)=16
Many thanks!