I am on Ubuntu and I did this command:
$ uname -a
Linux slabrams-desktop 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux
Does it mean I am on 32bit or 64 bit processor?
The reason I am trying to figure this out is that I was getting errors which looked like this:
cannot execute binary file
and from Googling, I thought it was a processor issue. Any ideas?
You can use
lscpu
.Further explanation of the Architecture field:
It means that you're running a 32-bit kernel, which means that you can only run 32-bit apps without the use of an emulator or virtualization.
If you want to see if your processor is 64-bit then look for
lm
in the flags listed in/proc/cpuinfo
.You can also check the architecture of the binary you're trying to run by using file:
file filetocheck
. It will mention either 32-bit or 64-bit.uname -p
give the architecture of the processor. If it givesx86_64
, it means cpu is 64 bit.Basic idea:
x86_64 is 64 bit capable cpu and i386 is 32 bit.
With lscpu
Long answer:
lscpu
Short answer
lscpu | awk '/CPU op-mode/ {print}
Output :
CPU op-mode(s): 32-bit, 64-bit
With lshw
Long answer: run
sudo lshw
Slightly shorter answer:
sudo lshw -c cpu
Output:
Even shorter answer:
sudo lshw -c cpu | grep width
Output:
width: 64 bits