How do I know if my linux kernel is running in 32bit or 64bit?
uname -a
will tell you the kernel - the end bit tells you the architecture.
Two examples:
My mac:
Darwin Mac.local 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386
My Dreamhost hosting:
Linux ecco 2.6.24.5-serf-xeon-c6.1-grsec #1 SMP Tue Oct 7 06:18:04 PDT 2008 x86_64 GNU/Linux
i386 = 32 bit
x86_64 = 64 bit
uname -m
will give you the architecture you kernel is compiled for. If it prints i686
then your kernel is 32 bit, if x86_64
then it's 64 bit, assuming you have an Intel/AMD chip.
I think the most precise way is
getconf LONG_BIT
here it exactly shows 64
found on this tip
getconf
is from package libc-bin (on ubuntu)