Question: How do I check whether my Linux operating system is running on 32-bit or 64-bit?
Answer: If you’ve installed it, you should know, as the installation CD (or ISO image) for a 32-bit Linux OS and 64-bit Linux OS are different. Let us assume that your sysadmin installed the OS, and you didn’t know whether he used a 32-bit or 64-bit Linux.
Method 1: Use uname -a to check 32-bit or 64-bit
Linux provides a command called uname, which prints system information including kernel version and whether kernel is 32 bit or 64 bit.
If the uname -a output displays x86_64, then the system is running 64bit Linux kernel.
If the uname -a output displays i386/i486/i586/i686, then the system is running 32bit Linux kernel.
The following example indicates that it is running on 64-bit Linux OS.
$ uname -a 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
You can also do “uname -m”, which displays only the 64 or 32 bit part as shown below.
$ uname -m x86_64
Method 2: Use /proc/cpuinfo
Execute “less /proc/cpuinfo” command to determine if the CPU on the server is 64 bit or 32 bit.
cpuinfo file displays the kernel bits in Linux operating system.
Execute the following command and if you see “lm” in the output, you have a 64 bit CPU based system.
$ grep flags /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 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
Comments on this entry are closed.
hi ,
There is one utility called “sysinfo.”
You have to install this utility.
On Ubuntu
$sudo apt-get install sysinfo
$sysinfo
You will get the graphical infomation about ypur oprating system,hardware, ect..
I hope this info help you.
getconf LONG_BIT will give the exact result.
Or on CentOS, you can type in >arch
Just type $ file /bin/ls
you will get the following.
“/bin/ls: ELF 32-bit MSB ”
Which stats that you are using 32 bit. This can run in any *nix
Selva, no.
You can use a 64 bits kernel with a 32 bits userland and your test fill give an incorrect information (saying that the binary is 32 bits while in fact it’s running with 64 bits).
The best way to find this is with getconf command
# getconf LONG_BIT
this will give you and output
Can someone please clarify these long pending question in my mid..would be really grateful if its sorted here..
What do i mean when i say i have 32/64 bit architecture , 32/64 bit OS, 32/64 bit compiler. How are they related what is compatible with other? How its related to a pointer’s size in c program? How 32/64 bit architecture thing is related to virtual address space that is available for an os on that architecture.
I know a little about this all but in bits and pieces, would be really great if its told in a manner thats uniqueness of TGS. 🙂
getconf LONG_BIT will give correct info