Operating System - Linux
1753639 Members
5460 Online
108798 Solutions
New Discussion юеВ

Re: how to know if it is 32 bit or 64 bit

 
khilari
Regular Advisor

how to know if it is 32 bit or 64 bit

Hi guys, i want to know as to with which command will u know if it is 32 bit or 64 bits OS on red hat linux.
Thanks
7 REPLIES 7
Luk Vandenbussche
Honored Contributor

Re: how to know if it is 32 bit or 64 bit

uname -i give you information about the hardware version (23 / 64 bit)
khilari
Regular Advisor

Re: how to know if it is 32 bit or 64 bit

[root@linux4 ~]# uname -i
i386
so i guess this means my system is 32 bits.
Luk Vandenbussche
Honored Contributor

Re: how to know if it is 32 bit or 64 bit

Yes,

Your server has 32 bit hardware

Ps : points are always appreciated
Matti_Kurkela
Honored Contributor

Re: how to know if it is 32 bit or 64 bit

If "uname -i" says "i386" it will definitely mean your OS is 32-bit.

However, it does *not* always mean your hardware is 32-bit only. For example, AMD Opterons can be used with either 32- or 64-bit OS.

If you install a 32-bit OS on a 64-bit AMD Opteron, "uname -i" will say "i386" exactly as on a 32-bit hardware. Only /proc/cpuinfo will reveal that your hardware would be capable of more. We had to do this to ensure a certain commercial software was supported (there was no official support for 64-bit platforms at the time we installed it, and the support was essential).

Mk
MK
Mike Stroyan
Honored Contributor

Re: how to know if it is 32 bit or 64 bit

Intel and amd processors that support em64t 64-bit mode will have a "lm" flag in the "flags:" line of /proc/cpuinfo. That "lm" flags stands for "long mode". (That does depend on your kernel being recent enough to check for the lm capability.)
Sac_3
Frequent Advisor

Re: how to know if it is 32 bit or 64 bit

Hi Khilari,

The "getconf" command returns the appropriatte output:

[root@Test01]# getconf LONG_BIT
32 -- 32bit OS
64 -- 64 bit OS

Regards,
SaC...
Maaz
Valued Contributor

Re: how to know if it is 32 bit or 64 bit

if the os is 32 bit, and processor is EMT-64(i.e 64 bit extension on top of 32 bit instruction set), then "getconf LONG_BIT" will always return "32"

I think Mike Stroyan has provided the right solution for EMT-64 processors when using 32 bit Linux OS.

Regards
Maaz