How to find whether Linux system is 32 bit or 64 bit in simple commands
To find whether Linux system is 32 bit or 64 bit in simple commands
In this article we will discuss how to find whether Linux system is 32 bit or 64 bit using the simple Linux commands.
File Command
This command helps to display the file type.
Syntax
file /sbin/init
Example
[user1@linuxhelp ~]$ 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.18, stripped
getconf Command
This command helps to displays the system configuration variables.
Syntax
getconf LONG_BIT
Example
[user1@linuxhelp ~]$ getconf LONG_BIT
64
Uname command
The command uname -a helps to display system type.
Syntax
uname -a
Example
[user1@linuxhelp ~]$ uname -a
Linux linuxhelp.1 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
For more info on uname command: https://www.linuxhelp.com/uname-command/
dpkg command
This command helps to display the Ubuntu and Debian OS.
Syntax
dpkg --print-architecture
Example:
For 32 bit
[user1@linuxhelp ~]$ dpkg --print-architecture
i386
For 64 bit
[user1@linuxhelp ~]$ dpkg --print-architecture
amd 64
arch Command
Syntax
arch
Example
[user1@linuxhelp ~]$ arch
x86_64
echo Command
Syntax
echo $HOSTTYPE
Example
[user1@linuxhelp ~]$ echo $HOSTTYPE
x86_64
For more info on echo command: https://www.linuxhelp.com/echo-commands-in-linux-2/
Comments ( 0 )
No comments available