≡ Menu

Linux Find Out CPU Architecture Information

How do I find out my CPU architecture information under Linux operating systems?

You can use /proc/cpuinfo file or use the lscpu command to get info about CPU architecture. It will display information like:

  • Number of CPUs
  • Threads
  • Cores
  • Sockets
  • NUMA nodes
  • Information about CPU caches,
  • CPU family, model and stepping.
  • in human-readable format. Alternatively, it can print out in parsable
  • format including how different caches are shared by different CPUs,
  • which can also be fed to other programs.

Open a terminal and type the following command:
$ less /proc/cpuinfo
OR
$ 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

OR see lscpu output using the following video:

Share this tutorial on:

Your support makes a big difference:
I have a small favor to ask. More people are reading the nixCraft. Many of you block advertising which is your right, and advertising revenues are not sufficient to cover my operating costs. So you can see why I need to ask for your help. The nixCraft, takes a lot of my time and hard work to produce. If you use nixCraft, who likes it, helps me with donations:
Become a Supporter →    Make a contribution via Paypal/Bitcoin →   

Don't Miss Any Linux and Unix Tips

Get nixCraft in your inbox. It's free:



{ 13 comments… add one }
  • vamsi May 27, 2011, 4:07 am

    /proc/cpuinfo

    is this file dynamically generated or cached ?
    can we edit this file ?

    Thanks !

  • Tapas Mallick June 7, 2011, 11:38 am

    is “lscpu” available for redhat and its variants ? It is really a cool command/tool to have with all Linux System Administrator.

    • Philippe Petrinko June 7, 2011, 12:53 pm

      Tapas,

      If [lscpu] does not exist for your distribution, you can always create a shell alias to create a shortcut of the following command

      alias lscpu=”/bin/cat /proc/cpuinfo|/bin/grep -E ‘processor|model name|cache size|core|sibling|physical'”

      Then afterwards, you can use this command anywhere.
      Just add it to your personal Bash customization startup file, located into your home directory, namely [ ~/.bashrc ] or sometimes specific included file [ ~/.bash-aliases ].

      Have fun !

      • Tryme June 7, 2011, 1:22 pm

        Philippe,

        Useless use of cat???

         
        alias lscpu=”/bin/grep -E 'processor|model name|cache size|core|sibling|physical' /proc/cpuinfo”
        

        Tapas,

        lscpu command available on latest version of Ubuntu, Debian, RHEL 6 and above.

  • Philippe Petrinko June 7, 2011, 3:02 pm

    “Useless use of cat?”

    Yeah, quite right, of course.

    alias lscpu=’/bin/grep -E “processor|model name|cache size|core|sibling|physical” /proc/cpuinfo’

    This will do the trick!

    • Tapas Mallick June 8, 2011, 7:11 am

      Appreciate your comment, but a vanilla grepping of /proc/cpuinfo with specified fields are not enough to get lscpu like detailed output. Its lacking of “Number of Physical CPU, Core per CPU, Threads in each Core, L1/D1/D3 Cache size, CPU Mode, Virtualization Technology Used, NUMA Node ID”. Of course bit sophisticated grepping/sorting/uniq on /proc/cpuinfo with generate the required output, still precompiled version of lscpu will be a great add-on for systemadmins.

  • vijay gupta June 9, 2011, 10:52 am

    Really helpful commands.

  • david June 23, 2011, 3:26 am

    thankz for the article…i was searching for this…

  • eepeesalimep December 26, 2011, 6:17 am

    Vivek-

    how we can check processor types like (dual core ,quadcore ) in linux mechine
    suppose my cpuimfo out put like Intel Xeon(R) CPUX5355 @ 2.66GHz how i know this is dualcore or quad core processor ?

  • Gorth Durak July 18, 2012, 2:52 am

    as a c++ guy, I’m trying to get my barecomputer_o (Vettrasoft Z Directory object)
    working on Debian linux – is there a [c function] OS API to get CPU info? I can
    fork()/exec() or do system(“lscpu > /tmp/somefile”) and do a bunch fo grunt
    Quick&Dirty hacking, not elegant
    In microsoft-land, I use a combo of __cpuid (CPUInfo, 0); and embedded assembler,
    eg,

    #if zos_MSWindows
        __asm
        {
            mov     eax,    1
            cpuid
            mov     EAXBuf, eax     // version
            mov     EBXBuf, ebx     // brand idx, max # CPUs
            mov     ECXBuf, ecx     // extended feature info
            mov     EDXBuf, edx     // feature info
        }
    #endif
        m_SteppingID = EAXBuf & 0x0000000F;
        m_Model      = EAXBuf & 0x000000F0;
        m_FamilyID   = EAXBuf & 0x00000F00;
        m_Model    >>= 4;
        m_FamilyID >>= 8;
        // etc etc.
    
  • Babin Lonston October 19, 2013, 10:37 am

    Its cant Editable Proc will get created while the system boots every time in RAM , U can create it manually if your Root User

Security: Are you a robot or human?

Leave a Comment

You can use these HTML tags and attributes: <strong> <em> <pre> <code> <a href="" title="">


   Tagged with: , , , , , , , , , , , , , , , , ,