Q. Quick question, how to determine if CPU is 64bit or not under Linux?
A. You need to use uname command, which prints system information including kernel version and whether kernel is 32 bit or 64 bit. You can also use less /proc/cpuinfo command determine if it is 64 bit cpu or not.
Example - Find out if Running kernel is 32 or 64 bit
$ uname -a
Output:
Linux ora100 2.6.5-7.252-smp #1 SMP Tue Feb 14 11:11:04 UTC 2006 x86_64 x86_64 x86_64 GNU/Linux
x86_64 GNU/Linux indicates I have 64bit kernel running. If you use see i386/i486/i586/i686 it is a 32 bit kernel.
How do I find out CPU is 32bit or 64bit?
Simply type the following command and if you see lm in output, you have a 64 bit system:
$ grep flags /proc/cpuinfo
Output:
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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm 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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm 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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm 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 nx lm constant_tsc pni monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr lahf_lm
- lm means Long mode - 64 bit CPU
- Real mode 16 bit CPU
- Protected Mode is 32-bit CPU
See also:
Updated for accuracy!
Want to read Linux tips and tricks, but don't have time to check our blog everyday? Subscribe to our daily email newsletter to make sure you don't miss a single tip/tricks. Subscribe to our weekly newsletter here!
- Email FAQ to a friend
- Printable version
- Rss Feed
- Last Updated: 5-13-08

{ 12 comments… read them below or add one }
Thanks for this short and sweet information without too much garbage….
all methods above are wrong. If the system was installed with 32bit OS the result will always be 32 unless it has a 64bit Linux running.
The correct way to do is:
cat /proc/cpuinfo
and look for flag “lm” in the flags: column. If it’s there then it’s 64bit CPU no matter Intel or AMD.
Thanks for this quick information. It was really helpful !!!
You can also try this to find out if your CPU/Processor is 32 bit or 64 bit:
# getconf LONG_BIT
32
Yeah… my power5 (ppc64) returns 32 for
getconf LONG_BIT
Thank U for Your Great post
Awesome! Exactly what i needed.
Good Job Man!!!
I this info is confusing in my Linux box when I run this command:
cat /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss nx lm constant_tsc up pni cx16 lahf_lm
and my uname -a command gives this info:
#1 SMP Fri Jan 26 14:15:21 EST 2007 i686 i686 i386 GNU/Linux
now what should I conclude does I am using both 32 and 64 bit?
saharey – it means that you are running a 32 bit kernel on a 64 bit cpu.
the info was great and very much helped me…
specially the one from ‘dguru’
thankyou once again….
cat /usr/include/asm/cpufeature.h
This will show you all the pertinent flags regarding your motherboards socket. If you have an AMD read the AMD defined features. If you have an Intel read the Intel defined features. I find that the ‘lm’ flag does show up on intel chips however so keep that in mind.
What about:
# getconf LONG_BIT
32
# grep flags /proc/cpuinfo
flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm constant_tsc pni monitor ds_cpl est cid cx16 xtpr lahf_lm
I know that this machine has 32bit processor, however, the lm flag is present. Does this make the lm flag unreliable for determining the cpu architecture?