Linux Display CPU Information Number of CPUs and Their Speed

How do I display CPU information like number of CPUs, threads, cores, sockets, NUMA nodes, information about CPU caches, CPU family, model and stepping and their speed on Linux operating systems?

You need to use Proc (/proc) file system provides information about CPU and their speed which is a pseudo-filesystem. It 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.
Tutorial details
Difficulty level Intermediate
Root privileges No
Requirements /proc, ls, and lscpu
Est. reading time N/A
You can also use the command called lscpu to display information on CPU architecture on modern Linux distributions.

Task: Display the number of processors in Linux

You need to use the /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:
$ more /proc/cpuinfo
$ cat /proc/cpuinfo
$ less /proc/cpuinfo
Sample outputs:

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 the output with the following commands, to display number of processors in the system:
$ grep processor /proc/cpuinfo

Say hello to lscpu

The lscpu command is CPU architecture information helper and can be found under Fedora Linux / RHEL / CentOS v6+ / Debian Linux v6+ and many other latest distro includes this command.
$ lscpu
Sample outputs:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
CPU(s):                8
Thread(s) per core:    2
Core(s) per socket:    4
CPU socket(s):         1
NUMA node(s):          1
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 30
Stepping:              5
CPU MHz:               1199.000
Virtualization:        VT-x
L1d cache:             32K
L1i cache:             32K
L2 cache:              256K
L3 cache:              8192K

Warning : lscput command has bug and sometimes in Xen Dom0 kernel reports wrong data. So please use /proc/cpuinfo for verification purpose.

Video demo: /proc/cpuinfo and lscpu command

See the following video demo:

See also:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 40 comments so far... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
40 comments… add one
  • wessy May 27, 2009 @ 9:25

    thanks, works

  • user Jul 1, 2009 @ 6:19

    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???!!

    • Vijay Kanta Jul 22, 2014 @ 7:24

      LOL funny answer, but the programs work fine for me. Thanks cyberciti.

    • Alex Oct 19, 2014 @ 21:20

      You actually have 16 cores, 8 phsical, 8 logical, Xeon processors have 2 threads per physical core, so, if you have Quad core, it will show 8 cores :)

  • Blake Acheson Jul 31, 2009 @ 17:34

    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

    • user1 Sep 7, 2013 @ 9:49

      It makes you wonder why he/she even needs two Xeons

      • PsyGuy Jun 23, 2015 @ 16:04

        Maybe HE/SHE doesn’t but the company DOES and they are not familiar with that.

  • Dave Feb 10, 2010 @ 14:36

    Many thanks!

  • thomasrutter May 5, 2010 @ 8:12

    For just the number of CPUs and speed, this may be simpler.

    cat /proc/cpuinfo | grep MHz

  • Walter Vos May 26, 2010 @ 7:29

    I have a VPS and am trying to figure out wether I should user prefork.c or worker.c (better with multiple processors I believe) with apache. I’m trying to decide this based on the number of processors I have. However, this is the info I’m getting from the command mentioned above:

    processor : 0
    vendor_id : GenuineIntel
    cpu family : 15
    model : 4
    model name : Intel(R) Xeon(TM) CPU 2.80GHz
    stepping : 1
    cpu MHz : 2798.083
    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 nx constant_tsc up pebs bts p
    bogomips : 5630.31
    clflush size : 64
    power management:

    Any thoughts on how to get the info that I’m looking for?

    • mmj Sep 21, 2010 @ 3:01

      Whether you have multiple processors or not doesn’t affect your choice between worker and prefork. They both will make full use of all your processors.

      Worker uses multiple threads within a unix process, so is more efficient. Prefork uses multiple processes, so you have extra overhead.

      There is no good reason to use prefork at all on any processor, except if you are running Apache modules which aren’t thread-safe. mod_php is the most common one, but you don’t need to use that as there is mod_fcgid and running PHP under fcgi.

  • Tricky Sep 20, 2010 @ 16:49

    A bit late however it might help someone else. I came across this as I was looking into a similar issue. The easiest way is per a forum entry at
    grep -c processor /proc/cpuinfo
    This returns the exact number of available cores, virtual or not.

    One way to find out how many physical socketed CPUs there are is to eliminate any extra cores:
    grep core\ id /proc/cpuinfo | grep -c \ 0$
    Unfortunately if multiple physical CPUs only have 1 core each this returns zero. The following (clumsy) group of commands will return the number of physical CPUs regardless of if there is only a single core per CPU:
    grep core\ id /proc/cpuinfo | grep -c \ 0$ | grep ^0$ >> /dev/null && grep -c processor /proc/cpuinfo || grep core\ id /proc/cpuinfo | grep -c \ 0$

    • Walter Vos Sep 20, 2010 @ 17:41

      Hi Tricky, thanks for the info! My output for these commands is 1, than 0, than 1 again. So I’m guessing my VPS uses 1 single core CPU?

      • Tricky Sep 21, 2010 @ 16:28

        That is correct – however the clumsy command should be run as one very long command all at once and you should only get 1 output result.

        Bear in mind that this long command is more informational than useful as it returns the number of processors – however an application should much rather want to know the number of cores.

        VPSs rarely get more than one core. If you have a quad-core physical server shared by 16 VPSs it makes no sense to have more than one virtual core assigned to each VPS.

        However if you have a single VPS on a quad-core physical server (there are some scenarios where this is a good idea) then it makes sense to have all 4 cores assigned to the single VPS.

    • arun Jan 23, 2012 @ 9:16

      Great.. its works for me.. thanks a lot

  • kishor Dec 12, 2010 @ 21:48

    hi , i am accessing a solaris server from putty. i dont find any cpuinfo file in proc directory, actually proc directory is for storing all fds. How can we find this file there? r tell me how to find CPU information in solaris.

  • Hristiyan Mar 5, 2011 @ 4:35

    Hello, friends
    In the terminal I typed the command
    cat /proc/cpuinfo
    and I got that:

    processor : 0
    vendor_id : AuthenticAMD
    cpu family : 16
    model : 4
    model name : AMD Phenom(tm) II X4 940 Processor
    stepping : 2
    cpu MHz : 800.000

    That is just a part of the hole text, but pay attention that: “cpu MHz: 800”. It is not correct, because my CPU speed is 3 GHz. Why is that?
    Thanks in advance.

  • Tricky Mar 7, 2011 @ 0:09

    @kishor – Solaris used to also have /proc/cpuinfo. But now, instead, I believe the command to use is “psrinfo -v”

    @Hristiyan – You might be using an application such as cpufreq. When your CPU is idle it can automatically throttle your CPU down to the lowest speed it can go in order to save energy (electricity costs/etc) as well as extend the life of the CPU. When your CPU gets really busy and 800MHz isn’t enough it should automatically increase it, possibly in increments, or maybe even straight back up to 3GHz. Google a bit for info on your distribution and CPU throttling and you will probably find relevant information on how to check this.

    I could always be wrong though. ;)

    • Hristiyan Mar 9, 2011 @ 4:11

      Thank you, Tricky, for the answer. I searched some info about my CPU and I found that you are right – 800 MHz is a power saving mode. That’s why CPU info tool displays such frequency.

  • Russell Apr 27, 2011 @ 6:17

    I was looking for processor architecture. In Ubuntu I find the following 2 command which was useful. These commands were absent in CentOS, RedHat and Slackware.
    # lshw
    # lscpu

  • Mallik May 18, 2011 @ 13:13

    processor : 3
    vendor_id : AuthenticAMD
    cpu family : 15
    model : 65
    model name : Dual-Core AMD Opteron(tm) Processor 2220
    stepping : 3
    cpu MHz : 2792.802
    cache size : 1024 KB
    physical id : 1
    siblings : 2
    core id : 1
    cpu cores : 2
    fpu : yes
    fpu_exception : yes
    cpuid level : 1
    wp : yes
    flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt
    rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
    bogomips : 5585.25
    TLB size : 1088 4K pages
    clflush size : 64
    cache_alignment : 64
    address sizes : 40 bits physical, 48 bits virtual
    power management: ts fid vid ttp tm stc

    what does cpu cores and siblings mean .

  • Tricky May 18, 2011 @ 19:05

    The siblings property is a way for you to see whether or not HyperThreading is in use.
    siblings=2 means that 1 physical core is showing in cpuinfo as if it were 2 cores.


  • Inukaze Oct 20, 2011 @ 0:26

    Hi there , under Ubuntu Maverick 10.10 i used this line to get CPU Speed Info :

    dmesg | grep “MHz processor” | cut -d ” ” -f07 | sed ‘s/[.].*//’

    But under Ubuntu Natty 11.04 , this dont work , and only show “evbug”
    and the “cat /proc/cpuinfo” its not util for me.

  • Nag Jan 31, 2012 @ 10:16

    I want to check the load of the CPU’s individually in linux,can any one help me on this..Thanks in advance

  • Jack Feb 2, 2012 @ 5:14

    Nag: In Fedora 13 you can see the CPU load graphically in real time: System > About This Computer > Resouces > CPU History.

  • Mannoj Mar 6, 2012 @ 12:34

    I’m not sure how you all the get the output for the number of processes but when I do in my server, I see it in seven entries having processor values like below. In this case can I consider I have 7 processors ? So even if top load avg shows ‘5’, I don’t have to worry…??

    [pprod@ssbank ~]$ grep processor /proc/cpuinfo
    processor : 0
    processor : 1
    processor : 2
    processor : 3
    processor : 4
    processor : 5
    processor : 6
    processor : 7

    • Tricky Mar 7, 2012 @ 0:34

      Since it is counting from zero, your output is showing 8 entries.

    • Tricky Mar 7, 2012 @ 0:44

      In theory having a load of 5 can be okay. Its probably better to measure other aspects of the server’s performance against what you really need, such as responsiveness.

      For example if a mail filtering server is slow and this causes a 1-2 minute delay in mail delivery, very few (if any) end-users are going to notice. All you might care about in that instance is how much mail per minute the server can handle and whether or not the server’s spools ever go out of control. The small backlog (thus causing the delay) isn’t good but it is not a mission-critical problem and the end-users are still happy.

      On the other hand, if a web server is slow end-users WILL notice, and they definitely won’t be happy. :)

    • mmj Mar 7, 2012 @ 1:02

      Load average is only a pretty rough indication of your load. It’s the queue depth, really.

      Hypothetically, close to 1 is ideal – it means your server is cruising along. As to what is too high, that doesn’t just depend on the number of processor cores but also on what exactly you’re doing. A load average of 11 might not faze a particular workload. If your workload is entirely comprised of stuff that does not need to be done immediately – that is, it’s just background processing, then it really doesn’t matter how high this gets.

      Think of it like people waiting in line at the airport, if there are four people serving and four people waiting it’s *okay*. If there are four people serving but usually only around one person waiting it’s ideal. If there are four people serving but 31 people waiting then obviously there’s going to be quite a delay. But you’re not taking into account how quickly each of those 31 people will be served. Hope this analogy helps.

      • Mannoj Mar 7, 2012 @ 4:37

        The explanation on load avg is quite perfect, but I have read somewhere if the load avg is 2 and it has 2 processor then its fine. If its a single processor then the ideal load avg should be lesser than 1. Not sure if this is how we should assume things against number of processor with load avg. vmstat and iostat shows idle time as 68%. But I don’t see any issues with end user, whereas my top proc is mysql demon for DB, pls see below. It has 5 as load avg and my total no: of procs are 8 so in this case I don’t have to worry according to my above approach, do let me know if I need to worry in the real world.

        top – 09:46:06 up 96 days, 13:25, 13 users, load average: 5.05, 4.82, 4.79
        Tasks: 410 total, 1 running, 403 sleeping, 0 stopped, 6 zombie
        Cpu(s): 39.5%us, 15.0%sy, 0.0%ni, 43.9%id, 0.8%wa, 0.1%hi, 0.7%si, 0.0%st
        Mem: 16624824k total, 16273580k used, 351244k free, 249740k buffers
        Swap: 32772332k total, 88k used, 32772244k free, 11028372k cached

        3125 mysql 25 0 601m 463m 5268 S 385.5 2.9 41175:58 mysqld
        31572 tpos 25 0 1273m 203m 7260 S 16.6 1.3 8:05.54 java

  • electro Jun 4, 2012 @ 19:11

    I typed the command known:
    grep -c processor /proc/cpuinfo
    and the result is 4. This number means 4 threads or 2 cores ?

    After that I try command:
    grep CPU /proc/cpuinfo

    and the result is:
    model name : Intel(R) Xeon(R) CPU 5140 @ 2.33GHz
    model name : Intel(R) Xeon(R) CPU 5140 @ 2.33GHz
    model name : Intel(R) Xeon(R) CPU 5140 @ 2.33GHz
    model name : Intel(R) Xeon(R) CPU 5140 @ 2.33GHz

    But if I install and configure nginx from the Debian repository, the OS download the amd64 package? Why? And working properly. Any explanation?

  • Jules Jun 18, 2012 @ 23:42

    thanks for the info, just what I needed. Who needs man pages eh? (or a memory for that matter!) :)

  • clark Nov 15, 2012 @ 8:40

    you can use

    watch “cat /proc/cpuinfo | grep MHz”

    to view ur cpu speed, it’ll refresh every 2.0 secs

  • guy damico May 17, 2014 @ 12:45

    How can I tell if my processor is PAE capable?
    Name : Intel(R) Pentium(R) M processor 1.70GHz
    Family, model, stepping : 6, 13, 6 (Pentium III/Pentium III Xeon/Celeron/Core Duo/Core Duo 2)
    Vendor : Intel
    Cache Size : 2048kb
    Frequency : 600.00MHz
    BogoMIPS : 1199.83
    Byte Order : Little Endian
    FDIV Bug : no
    HLT Bug : no
    F00F Bug : no
    Coma Bug : no
    Has FPU : yes
    Cache information not available
    fpu : Floating Point Unit
    vme : Virtual 86 Mode Extension
    de : Debug Extensions – I/O breakpoints
    pse : Page Size Extensions (4MB pages)
    tsc : Time Stamp Counter and RDTSC instruction
    msr : Model Specific Registers
    mce : Machine Check Architeture
    cx8 : CMPXCHG8 instruction
    sep : Fast System Call (SYSENTER/SYSEXIT)
    mtrr : Memory Type Range Registers
    pge : Page Global Enable
    mca : Machine Check Architecture
    cmov : Conditional Move instruction
    clflush : Cache Line Flush instruction
    dts : Debug Store
    acpi : Thermal Monitor and Software Controlled Clock
    mmx : MMX technology
    fxsr : FXSAVE and FXRSTOR instructions
    sse : SSE instructions
    sse2 : SSE2 (WNI) instructions
    ss : Self Snoop
    tm : Thermal Monitor
    pbe : Pending Break Enable
    up : smp kernel running on up
    bts : Branch Trace Store
    est : Enhanced SpeedStep
    tm2 : Thermal Monitor 2

  • Tricky May 19, 2014 @ 7:43

    Hi, Guy

    Based on what you pasted, your processor does not support PAE. Simplest check:
    grep -i pae /proc/cpuinfo

    If there are no results then your processor does not support PAE.

    Other ways to check:
    on Intel’s ARK site
    – the page doesn’t mention PAE at all.
    – the Wikipedia article on PAE – the page specifically mentions that “most” 400MHz-bus Pentium M processors did not support PAE.

  • CyrIng Feb 2, 2015 @ 7:05

    You can also read the cpuid instruction for PAE. The SysInfo of XFreq is using this instruction to show all features of the processor. The source code can be fetched at

  • Rakesh Mallick Apr 24, 2016 @ 18:57

    Thank You. The information given over here is very useful. I am using Fedora on my laptop
    This is what I got.

    [rakesh@localhost ~]$ lscpu
    Architecture: x86_64
    CPU op-mode(s): 32-bit, 64-bit
    Byte Order: Little Endian
    CPU(s): 2
    On-line CPU(s) list: 0,1
    Thread(s) per core: 1
    Core(s) per socket: 2
    Socket(s): 1
    NUMA node(s): 1
    Vendor ID: GenuineIntel
    CPU family: 6
    Model: 42
    Stepping: 7
    CPU MHz: 1200.000
    BogoMIPS: 4389.90
    L1d cache: 32K
    L1i cache: 32K
    L2 cache: 256K
    L3 cache: 2048K
    NUMA node0 CPU(s): 0,1

  • Jim Feb 1, 2017 @ 14:56

    It’s totally worthless on Mint 17.

    $: command not found

  • rino19ny Oct 4, 2017 @ 10:16

    can a kernel be SMP and yet “cat /proc/cpuinfo” shows only 1 CPU?

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum