Determining a 32 vs. a 64 bit kernel / CPU
There's a few ways avialable.
Using uname to check the machine hardware name:
32bit:
$ uname -m i386 $ uname -m i486 $ uname -m i586 $ uname -m i686
64bit:
$ uname -m x86_64 $ uname -m ia64
Checking a system binary (note - use a system binary as in the following because it should represent the system):
32bit:
$ file /sbin/init /sbin/init: ELF 32-bit LSB executable, ...
64bit:
$ file /sbin/init /sbin/init: ELF 64-bit LSB executable, ...
Checking for the "lm" CPU flag indicates hardware capability (but not necessarily that the running kernel is in 64 bit mode):
32bit:
$ grep 'flags.* lm ' /proc/cpuinfo
64bit:
$ grep 'flags.* lm ' /proc/cpuinfo flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt
References: