Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
12-02-2009, 06:23 AM
|
#1
|
LQ Newbie
Registered: Jun 2009
Location: Erode,TN,India
Distribution: Ubuntu
Posts: 13
Rep:
|
Find number of cores in my processor
I need to find the number of cores in my processor. I used . But i cant get the number of cores. Can somebody help me? thanks in advance....
|
|
|
12-02-2009, 06:27 AM
|
#2
|
LQ Newbie
Registered: Dec 2009
Distribution: CentOS, LinuxMint, Mandriva, Slackware
Posts: 6
Rep:
|
The same command works in my case. I used along with 'cat' though.
Here is my output, is the info you are looking present?
Code:
[root@mandriva sv]# cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T5270 @ 1.40GHz
stepping : 13
cpu MHz : 800.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
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 constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida
bogomips : 2791.74
clflush size : 64
power management:
processor : 1
vendor_id : GenuineIntel
cpu family : 6
model : 15
model name : Intel(R) Core(TM)2 Duo CPU T5270 @ 1.40GHz
stepping : 13
cpu MHz : 800.000
cache size : 2048 KB
physical id : 0
siblings : 2
core id : 1
cpu cores : 2
apicid : 1
initial apicid : 1
fdiv_bug : no
hlt_bug : no
f00f_bug : no
coma_bug : no
fpu : yes
fpu_exception : yes
cpuid level : 10
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 constant_tsc arch_perfmon pebs bts pni dtes64 monitor ds_cpl est tm2 ssse3 cx16 xtpr pdcm lahf_lm ida
bogomips : 2792.20
clflush size : 64
power management:
Last edited by sv*; 12-02-2009 at 06:30 AM.
|
|
|
12-02-2009, 06:32 AM
|
#3
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
You need to look for the following entries in the output of /proc/cpuinfo:
physical id and siblings
The example in post #2 is one processor with 2 cores.
The next example has 2 processors, both have 4 cores:
Quote:
# cat cpuinfo | egrep "physical|sibling"
physical id : 0
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 1
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 0
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 1
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 0
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 1
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 0
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
physical id : 1
siblings : 4
address sizes : 38 bits physical, 48 bits virtual
|
And there is, of course, the cpu cores, which I overlooked in my initial answer.....
Hope this helps.
|
|
|
12-02-2009, 06:48 AM
|
#4
|
LQ Newbie
Registered: Jun 2009
Location: Erode,TN,India
Distribution: Ubuntu
Posts: 13
Original Poster
Rep:
|
But i am geting the following output:
Quote:
ubuntu@ubuntu:~$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 15
model : 4
model name : Intel(R) Pentium(R) D CPU 2.66GHz
stepping : 8
cpu MHz : 2661.550
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 constant_tsc up pebs bts tsc_reliable pni ds_cpl
bogomips : 5323.10
clflush size : 64
power management:
ubuntu@ubuntu:~$
|
Number of cores are not displayed.  I am running ubuntu in VMWare. Will that cause any difference?
|
|
|
12-02-2009, 06:52 AM
|
#5
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
I do believe that if you run from inside a virtual machine you do not get the info about the real cpu(s) present (when using /proc/cpuinfo).
Have a look if /proc/vmware/cpuinfo exists and if it does, check that one.
Hope this helps.
|
|
|
12-02-2009, 06:58 AM
|
#6
|
LQ Newbie
Registered: Jun 2009
Location: Erode,TN,India
Distribution: Ubuntu
Posts: 13
Original Poster
Rep:
|
Mr.druuna, /proc/vmware/cpuinfo doesnt work. let me try outside virtual machine. Then, how to display core alone? i mean, how to parse the output?
|
|
|
12-02-2009, 07:06 AM
|
#7
|
Senior Member
Registered: Sep 2007
Posts: 1,047
Rep:
|
Quote:
Originally Posted by ttsdinesh
Mr.druuna, /proc/vmware/cpuinfo doesnt work. let me try outside virtual machine. Then, how to display core alone? i mean, how to parse the output?
|
Yes,try from outside vmwire and post result
|
|
|
12-02-2009, 07:08 AM
|
#8
|
LQ Veteran
Registered: Sep 2003
Posts: 10,532
|
Hi,
I would grep both cpu cores and physical id, this to make sure that if you have more then one cpu you will notice:
egrep "physical id|cpu cores" /proc/cpuinfo
The above command will show only those 2 fields (which could show up multiple times).
If the physical id field only has one number (0 / zero) you have one cpu, if you see 0 and 1 you have 2 cpu's.
The cpu cores filed shows the amount of cores for one cpu.
If cpu cores says 4 and you have both 0 and 1 entries for physical id, you have 8 cores in total.
BTW: No Mr. needed 
|
|
1 members found this post helpful.
|
12-02-2009, 07:16 AM
|
#9
|
LQ Newbie
Registered: Jun 2009
Location: Erode,TN,India
Distribution: Ubuntu
Posts: 13
Original Poster
Rep:
|
Thank u for ur help.
|
|
|
All times are GMT -5. The time now is 03:53 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|