When running uname -a
, I get as output
41-Ubuntu SMP Mon Aug 13 17:59:54 UTC 2012 i686 athlon i386 GNU/Linux
Can someone please explain to me why both i386 & i686 ?
What exactly is my PC architecture and what version of Ubuntu am I using (32bit or 64bit)?
The command is
uname -m
.Open a terminal try using
uname -m
command. This should show you the OS architecture.If it gives any output like
ix86
, where x is 3,4,5 or 6, Your OS is 32bit.You can also see the Ubuntu architecture by Opening "System monitor" and going in the System tab.
Difference between hardware platform and Processor type:
There is a difference between the hardware platform (which is given by
-i
switch) to the CPU type (given by-p
switch).The hardware platform tells us which architecture the kernel is built for (may be optimized though for later versions). It can be a i386.
However the Processor type refers to the actual processor type of your machine such as i686 (P4 and later builds).
Thanks to Schotty of this this page. Here is an answer from Unix stackexchange site on the same topic, though I didn't find the language enough clear (completely my fault).
Use Anwar's answer to find the architecture.
Now here is the explanation for your second part of the question.
Below is the
uname
output: In my case I have installed a 32 bit version. Both i386 and i686 refer 32 bit version.uname
will return x86_64 in case if it is a 64 bit version.Below is grabbed from
uname --help
page which might help you to understand more about it.For debian Linux derived systems, one possible command is
dpkg-architecture -q DEB_BUILD_ARCH
.On 64bits systems, it returns :
On 32bits systems, it returns :
If all you want is the architecture you could always try the command called arch. It is very terse. It is not POSIX.
use syscap from Formake project https://sourceforge.net/projects/formake syscap allows to probe many system properties and test dependencies. It is a portable shell script.