Sometimes you may need to find out if your Linux kernel is 32-bit or 64-bit. For example, 64-bit software packages do not run on 32-bit and vice versa. In this article, we will look at how to determine kernel architecture in Linux. You can use these commands on almost every Linux distribution.
How to Determine Kernel Architecture in Linux
It is very easy to determine kernel architecture in Linux. Here are some of the most common ways to find out system architecture.
1. Using uname
Just open terminal and run the following command.
$ uname -m
If you see output as i386 or i686 it means your Linux kernel architecture is 32-bit. If you see output as x86_64 then it is 64-bit.
If you want more detailed information about your Linux kernel, such as its name, release, version, hardware name, os type, etc, then run uname -a command instead.
2. Using arch
You can also use arch command to get kernel architecture.
$ arch
It also gives the same output as uname -m. It prints i386 or i686 for 32-bit systems, and x86_64 for 64-bit systems.
3. Using File command
You can also use File command with /lib/systemd/systemd argument to view detailed system information, just as using uname -a. In this case, the output will contain software version as second value.
$ file /lib/systemd/systemd /lib/systemd/systemd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0...
4. lscpu
lscpu is another command that displays complete details about your Linux kernel architecture. The first line of output displays whether it is 32-bit or 64-bit. Here is an example.
~$ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 1 On-line CPU(s) list: 0 Thread(s) per core: 1 Core(s) per socket: 1 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 63 Model name: Intel(R) Xeon(R) CPU E5-2676 v3 @ 2.40GHz Stepping: 2 CPU MHz: 2399.939 BogoMIPS: 4800.17 Hypervisor vendor: Xen Virtualization type: full L1d cache: 32K L1i cache: 32K L2 cache: 256K L3 cache: 30720K NUMA node0 CPU(s): 0
In this article, we have seen 4 ways to view kernel architecture in Linux.
Also read:
How to List All Cron Jobs for All Users in Linux
How to Check Crontab Logs in Linux
How to Add Repository in Ubuntu/Debian Linux
How to Add Directory to PATH in Linux
How to Update Linux Kernel to Latest Version