How to find architecture of a Linux OS (32 bit or 64 bit)

Blog of interesting data center technical tips / tasks / articles which we come across

How to find architecture of a Linux OS (32 bit or 64 bit)

August 2, 2014 Linux 0

I have been using getconf to find architecture of a linux os (32 bit or 64 bit) for a quite some time. But today, I came to know that there are several other ways to check this too.

This is what I have been using:
[]# getconf LONG_BIT


Other options are:

[]# arch
[ ~]# uname -m
[ ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 3
On-line CPU(s) list: 0-2
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 3
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 45
Stepping: 7
CPU MHz: 2700.000
BogoMIPS: 5400.00
Hypervisor vendor: VMware
Virtualization type: full

L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 20480K
NUMA node0 CPU(s): 0-2
[ ~]# file /bin/ls
/bin/ls: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, stripped

Note that the last command helps us find out if the system is a physical or virtual machine and also to know what is the virtualization platform.


Leave a Reply

Your email address will not be published. Required fields are marked *