Number of CPU in LINUX server

I want to find number of CPU and number NIC card in Linux server.

I have below content in /proc/cpuinfo. I have from processor 0 - 15. It means, i have 15 similar entries in that file. How many CPU we have on this server? also how do find how many NIC card on this?

processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 6
model name      :                   Intel(R) Xeon(TM) CPU 3.20GHz
stepping        : 8
cpu MHz         : 3192.180
cache size      : 8192 KB
physical id     : 0
siblings        : 4
core id         : 0
cpu cores       : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 6
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 syscall lm pni monitor ds_cpl est tm2 cid cx16 xtpr lahf_lm
bogomips        : 6393.99
clflush size    : 64
cache_alignment : 128
address sizes   : 40 bits physical, 48 bits virtual

0 - 15 means 16 CPU cores.

thanks,

You may not have 16 CPU cores. With technologies like hyperthreading, you may have fewer total CPU cores however you will have 16 logical cores (The difference is that the logical cores may share resources and may not be real CPU cores).

Your best bet would be to find the type of CPU in your system. Here is one way to do so:

dmidecode | grep -i CPU
        Version: Intel(R) Xeon(R) CPU           E5530  @ 2.40GHz
        Version: Intel(R) Xeon(R) CPU           E5530  @ 2.40GHz

Compare that to:

cat /proc/cpuinfo | grep -i proc
processor       : 0
processor       : 1
processor       : 2
processor       : 3
processor       : 4
processor       : 5
processor       : 6
processor       : 7
processor       : 8
processor       : 9
processor       : 10
processor       : 11
processor       : 12
processor       : 13
processor       : 14
processor       : 15

I know for a fact that I have only 8 discrete CPU cores, 4 on each of 2 sockets.

Now, to find out how many ethernet cards you have:

ifconfig -a | grep -i eth
eth0      Link encap:Ethernet  HWaddr 00:08:74:XX:XX:XX (X to block out my real MAC address)

You may also use lshw command to list out hardware details in more user friendly manner.

use lspci to list all pci on your box