>

Linux: How to Identify 32bit vs. 64bit

TipsTricksBanner
Often I find that I am needing to determine a) if an O/S install is 32bit or 64bit and b) if the CPU will support 64bit. I run into a lot of Linux boxes that have 64bit CPUs but the 32bit version of the distribution was installed. Here are a few quick ways to tell.

For the O/S:

The architecture should be listed as x86_64 for 64bit or i686 for 32bit.

Using uname (-m or -p):

64bit

$ uname -m
x86_64
$ uname -p
x86_64

32bit

$ uname -m
i686
$ uname -p
i686

or using lscpu:

64bit

$ lscpu | grep -i arch
Architecture:          x86_64

32bit

$ lscpu | grep -i arch
Architecture:          i686

or using getconf:

64bit

$ getconf LONG_BIT
64

32bit

$ getconf LONG_BIT
32

For the CPU:

Using lscpu:

64bit

$ lscpu | grep op-mode
CPU op-mode(s): 32-bit, 64-bit

32bit

$ lscpu | grep op-mode
CPU op-mode(s):        32-bit

or check /proc/cpuinfo for the tm/lm flags. If lm exists it supports 64bit. If only tm exists, it only supports 32bit.

64bit

$ grep -w lm /proc/cpuinfo
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 aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority
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 aperfmperf pni dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 xsave lahf_lm dts tpr_shadow vnmi flexpriority

32bit

$ grep -w lm /proc/cpuinfo
$ grep -w tm /proc/cpuinfo
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts aperfmperf pni monitor vmx est tm2 xtpr pdcm dtherm
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx constant_tsc arch_perfmon bts aperfmperf pni monitor vmx est tm2 xtpr pdcm dtherm
banner ad

Comments are closed.