TIP: How to tell whether your system is 32-bit or 64-bit in Linux?
Purpose: Suppose you are given a system with no labels, stickers, product information. All you know that it is a Pentium class computer and you would like to know whether the given CPU/system (and not OS) is 32-bit or 64-bit capable? There are many different ways to find out without looking into BIOS and without trying a 64-bit kernel. I am going to list some of the methods below. All you need to do is run a generic x86 Linux kernel which is pretty much the default kernel in almost all Linux distribution.
Method 1: /proc
# cat /proc/cpuinfo | grep flags
and look for the word “lm” in the output. For example:
# cat /proc/cpuinfo | grep flags
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm ida
#
The word “lm” stands for “Long Mode”. If you do see “lm” that means your system is 64-bit capable.
Method 2: lshw
# apt-get install lshw
# lshw > lshw.txt
# less lshw.txt
You should be able to something like this in the beginning of the output if your machine is 64-bit capable:
*-cpu:0
description: CPU
product: Genuine Intel(R) CPU @ 2.20GHz
vendor: Intel Corp.
physical id: 4
bus info: cpu@0
version: 6.15.9
serial: 0000-06F9-0000-0000-0000-0000
slot: U2E1
size: 2200MHz
capacity: 4096MHz
width: 64 bits
capabilities: boot fpu fpu_exception wp vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx x86-64 constant_tsc arch_perfmon pebs bts pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm ida
That it. So even though we were running a 32-bit (386) kernel, we were still able to find out if the CPU is 64-bit capable or not.
Hope one of the methods works for you.


Email Subscription









June 9th, 2009 at 7:22 pm
[...] and their supported features. For example, with this utility you can say whether your machine is a 32-bit or a 64-bit capable system. As per package’s description page: x86info displays diagnostic information about the CPUs [...]
May 6th, 2011 at 2:32 am
Thanks.
At least in Mint and Ubuntu one can improve this a bit:
TO KNOW IF THE COMPUTER (CPU) IS OF 32 OR 64 BITS:
For above’s method 1:
cat /proc/cpuinfo | grep -w lm
or
more /proc/cpuinfo | grep -w lm
or
less /proc/cpuinfo | grep -w lm
or
grep -w lm /proc/cpuinfo
or
grep -iw lm /proc/cpuinfo
or
grep –color=always -iw lm /proc/cpuinfo
….
These ones highlight “lm” if it appears in red color.
For above’s method 2:
sudo lshw | grep “description: CPU” -A 12 | grep width
This shows only the line of interest.
//////////////////////////////////////
//////////////////////////////////////
TO KNOW IF THE INSTALLED MINT OR UBUNTU IS OF 32 OR 64 BITS:
uname -m
If it takes out i686 or i386 it means 32 bits.
If it shows x86_64 it means 64 bits.
//////////////////////////////////////
//////////////////////////////////////
If the computer is of 32 bits Mint or Ubuntu must be of 32 bits.
If the computer is of 64 bits it can work in 64 or 32 bits. So we can choose: Mint or Ubuntu can be of 32 bits or of 64 bits.
//////////////////////////////////////
//////////////////////////////////////
Link: https://help.ubuntu.com/community/32bit_and_64bit
Reply to this comment
May 6th, 2011 at 3:35 am
Another way to know if the installed OS is of 32 or 64 bits:
getconf LONG_BIT
Reply to this comment
June 3rd, 2011 at 6:45 am
In the command …
sudo lshw | grep “description: CPU” -A 12 | grep width
… the quotation marks have to be vertical so it works.
Probably they have been converted again in typographic ones. I hope they appear well now (I’m using the HTML code for them: ampersand number sign 34 semicolon):
sudo lshw | grep "description: CPU" -A 12 | grep width
Reply to this comment
April 10th, 2013 at 12:49 pm
I use “lscpu” to do that.
Reply to this comment