How to find out linux operating system system is 32 bit or 64 bit

Information TechnologyLinux

Many users are confused whether Linux system’s OS is 32-bit or 64-bit. As we all know, we can’t install 64-bit applications into a 32-bit OS type. Before re-installing Linux or clean Linux, we should verify if Linux system OS is 32-bit or 64-bit. This article guides you about “How to find out Linux operating system system is weather 32-bit or 64-bit”.

uname Command

uname is the universal command and it will work on almost all Linux/Unix operating systems. The below command will display your Linux system’s OS type-

$ uname -a

The sample output should be like this –

$ uname -a
Linux linux 4.2.0-30-generic #35~14.04.1-Ubuntu SMP Fri Feb 19 14:48:13 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

dpkg Command

dpkg Command will work only on Debian and Ubuntu based distributions and it’s derivatives. The below command will display your Linux system’s OS type-

$ dpkg --print-architecture

If the system is 64 bit then the result should be like this –

amd64

If the system is 32 bit then the result should be like this –

i386

getconf Command

getconf command will display the system configuration variables. To display about operating system, use the following command –

$ getconf LONG_BIT

The sample output should be like this –

$ getconf LONG_BIT
64

To get more information refer man  command –

$ man getconf

The sample output should be like this –

GETCONF(1)          Debian GNU/Linux          GETCONF(1)
NAME
   getconf - Query system configuration variables
SYNOPSIS
   getconf -a
   getconf [-v specification] system_var
   getconf [-v specification] path_var pathname
DESCRIPTION
   -a
      Displays all configuration variables for the current system and their values.
   -v
      Indicate the specification and version for which to obtain configuration variables.

arch Command

arch command will display your OS type and it is very similar to uname -m command. If an output is x86_64 then it is 64-bit OS or else gives the result as i686 or i386, then it’s 32-bit OS.

The command should be like this –

$ arch

The sample output should be like this –

$ arch
x86_64

file Command

file command with a special argument /sbin/init will display the OS type. the command should be shown below –

$ file /sbin/init

The output should be like this –

/sbin/init: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=7a4c688d009fc1f06ffc692f5f42ab09e68582b2, stripped

The above command explains about operating system type. You can see from the above that, our system is 64 bit.

Congratulations! Now, you know “How to find out Linux operating system system is 32-bit or 64-bit”. We’ll learn more about these types of commands in our next Linux post. Keep reading!

raja
Published on 18-Oct-2019 13:36:22
Advertisements