Jason
Jason

Reputation: 12789

How to find the processor / chip architecture on Linux

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

linux-x86-32
linux-x86-64
linux-ppc-64

Upvotes: 55

Views: 106804

Answers (6)

Ewilan R.
Ewilan R.

Reputation: 469

You could use lscpu with grep to get only architecture.

lscpu | grep Architecture | awk {'print $2'}

Example output:

x86_64

Upvotes: 3

joet3ch
joet3ch

Reputation: 2512

To display kernel architecture: uname -p

To display extended CPU details: cat /proc/cpuinfo

Upvotes: 89

infoclogged
infoclogged

Reputation: 4017

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.

Upvotes: 7

Montells
Montells

Reputation: 6679

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.

Upvotes: 34

James Ko
James Ko

Reputation: 34609

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.

Upvotes: 33

Jack
Jack

Reputation: 101

see (man uname):

echo `uname -s`-`uname -p`

Upvotes: 10

Related Questions