CPU and Cores information

Hi all.
I have a question about linux command to find number of CPU and Core.
I usually use the command dmidecode -t processor to find cpu and core numbers . On this machine with Red Hat 4. 0 when I try to insert the command is returned the error

-bash: dmidecode: command not found

I try to use the following command

cat /proc/cpuinfo | grep processor | wc -l
1

cat /proc/cpuinfo | grep cpu | wc -l
3

It is mean that on the machine there is only one processor with 3 cores?
thanks a lot for the collaboration

What does

cat  /proc/cpuinfo 

show? Please post. This should give you an answer.

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping        : 9
cpu MHz         : 3000.246
cache size      : 1024 KB
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 nx lm
bogomips        : 5989.99

What would lscpu yield?

If that's all /proc/cpuinfo had, you have one core. (Or perhaps, only one core detected/supported by the kernel - but this looks like an old Pentium 4, which could conceivably be single-core.)

1 Like

To Find how many cores and cores per socket:

#lscpu | grep -i 'socket'

To Find how many CPUs :

#grep -i "physical id" /proc/cpuinfo | sort -u | wc -l

Best way will be the usage of xsos command.(This work on RHEL4)
You can get it on github site.

Cheers...!

Hi all,
I am confused how is possible to find the physical cores and cpu installed on a Centos 5.5 machine.
I tried several commands with different answers (below are reported the command tried and the answers).
Can you help me to find the total phisical core and cpu per core?
Thanks a lot

  1. I tried the dmidecode -t processor but the answer is
# dmidecode 2.10
/dev/mem: Permission denied
  1. I insert the command
more /proc/cpuinfo and the answer is
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 1
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 2
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 3
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 4
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 4
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 5
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 5
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 6
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 6
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 7
vendor_id       : GenuineIntel
cpu family      : 6
model           : 44
model name      : Intel(R) Xeon(R) CPU           E5620  @ 2.40GHz
stepping        : 2
cpu MHz         : 2400.086
cache size      : 12288 KB
physical id     : 7
siblings        : 1
core id         : 0
cpu cores       : 1
fpu             : yes
fpu_exception   : yes
cpuid level     : 11
wp              : yes
flags           : fpu de tsc msr pae mce cx8 apic sep mtrr mca cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc ida arat pni est ssse
3 cx16 sse4_1 sse4_2 popcnt lahf_lm
bogomips        : 6002.38
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:
  1. I insert cat /proc/cpuinfo | grep processor | wc -l and the anwer is
    8

  2. I insert cat /proc/cpuinfo | grep cpu | wc -l and the anwer is
    32

The string "processor" is 8 times in this text. The string "cpu" 32 times. You just count words in a text. So 8 cores is maybe what you are looking for. Refer to what has been already written to you here:

This is completely different than before, did you run it on the wrong machine?

Anyway, I've highlighted the hyperthreading tag in red. This means half the cores are just artifacts of how an OS handles hyperthreading, and not real cores. So this is a 4-core system, not eight.