Operating System - Linux
1753797 Members
6990 Online
108799 Solutions
New Discussion юеВ

How to find out how many CPU's on a LINUX box

 
SOLVED
Go to solution
Vikas Khator
Honored Contributor

How to find out how many CPU's on a LINUX box

Hi ,

I have Red Hat linux box (6.2) . Is there a way I can find out how many CPU's on that box ?

I need to be able to use a command to find the above information to be able to use it ina a script.

Regards,
Vikas
Keep it simple
2 REPLIES 2
Dave Kelly_1
Respected Contributor
Solution

Re: How to find out how many CPU's on a LINUX box

If you have the /proc file system, check /proc/cpuinfo.

In a multi-processing environment, you are likely to see something like this:


processor : 0
cpu : 686
model : 3
vendor_id : GenuineIntel
stepping : 3
fdiv_bug : no
hlt_bug : no
fpu : yes
fpu_exception : yes
cpuid : yes
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic 11 mtrr pge mca cmov mmx
bogomips : 267.06

processor : 1
cpu : 686
model : 3
vendor_id : GenuineIntel
stepping : 3
fdiv_bug : no
hlt_bug : no
fpu : yes
fpu_exception : yes
cpuid : yes
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic 11 mtrr pge mca cmov mmx
bogomips : 267.06
Marcel Eken_2
Frequent Advisor

Re: How to find out how many CPU's on a LINUX box

Hi Vikas,

Another option is to use the command 'dmesg | grep -i processor'

This show the messages from the hardware inquiry at boot time and also the number of processors in the system. This command show also other hardware like disks and serial/parallel ports.

Kind regards,

Marcel Eken.