This tutorial describes how to find out whether your Linux system’s OS is 32-bit or 64-bit. This will be helpful if you wanted to download or install an application in your Linux system. As we all know, we can’t install 64-bit applications into a 32-bit OS type. That’s why knowing your Linux system’s OS type is important.
Check Linux System is 32-bit or 64-bit
Here are the five easy and simple methods to verify your Linux system’s OS type. It doesn’t matter whether you’re using a GUI or CLI type systems, the following commands will work on almost all Linux operating systems such as RHEL, CentOS, Fedora, Scientific Linux, Debian, Ubuntu, Linux Mint, openSUSE etc.
1. uname Command
uname -a command will display your Linux system’s OS type. This is the universal command and it will work on almost all Linux/Unix operating systems.
To find out the system’s OS type, run:
$ uname -a Linux tecmint.com 3.13.0-37-generic #64-Ubuntu SMP Mon Sep 22 21:28:38 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
2. dpkg Command
dpkg command will also display whether your Debian/Ubuntu operating system is 32-bit or 64-bit. This command will work only on Debian and Ubuntu based distributions and it’s derivatives.
Open your Terminal, and run:
$ dpkg --print-architecture
If your OS is 64-bit, you’ll get the following output:
amd64
If your OS is 32-bit, then the output will be:
i386
3. getconf Command
getconf command will also display the system configuration variables. Now, let me show you how to find out the Linux system arch using getconf command.
$ getconf LONG_BIT 64
For more details refer the man pages.
$ man getconf
4. arch Command
arch command will display your OS type. This command is similar to uname -m command. If its output is x86_64 then it’s 64-bit OS. If the output is i686 or i386, then it’s 32-bit OS.
$ arch x86_64
5. file Command
file command with with a special argument /sbin/init will display the OS type.
$ file /sbin/init /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
Conclusion
You now know the ways to find out your Linux operating system’s type. Of course, there are few other ways to find out the OS type, but these are the often and pragmatic methods so far. If you know any other commands or methods to display the OS type, feel free to let us know in the comments section below.
Source: tecmint.com