There are several ways to determine if a Linux system is 32-bit or 64-bit.
- One way is to use the
uname
command with the-m
option, which will print the machine hardware name of the system. If the output is “i686” or “i386”, the system is 32-bit. If the output is “x86_64”, the system is 64-bit.
uname -m
- Another way is to use the
getconf
command with theLONG_BIT
option, which will print the number of bits used by the system’s word size. If the output is “32”, the system is 32-bit. If the output is “64”, the system is 64-bit.
getconf LONG_BIT
- You can also use the
lscpu
command, which shows information about the CPU architecture and related information. In the output, look for the “Architecture:” field. If it says “x86_64”, the system is 64-bit. If it says “i686” or “i386”, the system is 32-bit.
lscpu
- Another method is to use
file
command on the binary/bin/ls
or/bin/bash
and check the output, if it contains x86-64, it’s 64 bit and if it contains i386, it’s 32 bit
file /bin/ls
In most modern systems, 64-bit will be the architecture, however, some older systems and embedded systems may still be using 32-bit architecture.