37

What command should I use to find the processor / chip architecture on Linux?

linux-x86-32
linux-x86-64
linux-ppc-64
Matthias Braun
  • 28,341
  • 18
  • 134
  • 157
Jason
  • 11,501
  • 18
  • 47
  • 66
  • 3
    `uname -m` gives you back `i686` or `x86_64` depending on 32-bit or 64-bit Intel CPU, but I don't have access to machines on non-Intel architectures. – 逆さま Aug 15 '11 at 15:13
  • uname -m says i686. How do I know if its 32 or 64 bit? – Jason Aug 15 '11 at 15:23
  • 4
    x86_64 or amd64 would be 64-bit. i386, i486, i586, and i686 are 32-bit. Keep in mind however that those values are merely a reflection of the target the kernel was compiled for and not necessarily what the CPU is capable of. – James O'Doherty Aug 15 '11 at 16:31
  • 1
    To know the current architecture of your OS type: `getconf -a | grep LONG_BIT` – Watchmaker Jul 08 '15 at 20:06

5 Answers5

50

To display kernel architecture: uname -p

To display extended CPU details: cat /proc/cpuinfo

Slava Fomin II
  • 23,934
  • 27
  • 112
  • 191
joet3ch
  • 2,096
  • 1
  • 20
  • 19
  • 13
    More specifically, `uname -p` for processor architecture. – Steve Wang Aug 15 '11 at 15:12
  • 5
    `uname` (with *any* options) will only show the *kernel* architecture, not the physical CPU architecture. In other words, it will show which CPU the kernel was compiled for. But that could show i386 even when running on a x86_64 CPU. – Dan Moulding Jun 23 '17 at 18:03
  • 2
    `uname -p` gives me `unknown` – Elie G. Nov 04 '21 at 23:47
27

In the terminal, type

lscpu

which returns output like this:

Architecture:          i686
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
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 23
Stepping:              6
CPU MHz:               2670.000
BogoMIPS:              5320.13
L1d cache:             32K
L1i cache:             32K
L2 cache:              3072K

To only get the architecture:

lscpu | grep Architecture

Which in this case is

Architecture:          i686

See man lscpu for more.

Matthias Braun
  • 28,341
  • 18
  • 134
  • 157
Montells
  • 6,059
  • 4
  • 46
  • 49
16

I'm surprised no one suggested uname -m. On my laptop, this gives armv7l, while uname -a gives me a monstrous two lines of text.

Matthias Braun
  • 28,341
  • 18
  • 134
  • 157
James Ko
  • 29,012
  • 25
  • 114
  • 214
9

see (man uname):

echo `uname -s`-`uname -p`
Delimitry
  • 2,881
  • 4
  • 30
  • 38
Jack
  • 91
  • 1
  • 1
7

A concise command producing information about the current machine is hostnamectl. Example output:

Static hostname: xxxx
Icon name: computer-laptop
Chassis: laptop
Boot ID: b3a1f952c514411c8c4xxxxxxxxxxxx
Operating System: Ubuntu 14.04.3 LTS
Kernel: Linux 3.19.0-43-generic
Architecture: x86_64

It gives you the most basic information about your machine. Other commands like uname, lsb_release, or lscpu return more specific information.

Matthias Braun
  • 28,341
  • 18
  • 134
  • 157
infoclogged
  • 3,141
  • 2
  • 26
  • 49