How to check if the CPU is 64/32 bit in a Linux system

As a system administrator and IT professional, it is very important to know whether the system is CPU architecture is 32-bit or 64-bit.

For third-party applications, you need to be aware of your system architecture as the 64-bit applications cannot run on a 32-bit system. While we can run 32-bit applications on a 64-bit system without any problems.

This article shows how to check that CPU architecture on one Linux Machine.

1. Using the lscpu command

Lscpu is a handy command to get CPU architecture information in Linux.

Access your terminal and enter the following command:


$ lscpu

This command lists the CPU information in your terminal as follows:


Use the lscpu command to get CPU information

The architecture field shows what type of CPU you have. Here x86_64 means 64 bit.

the CPU operating mode is 32-bit and 64-bit. This means that your CPU supports both 32- and 64-bit instructions.

Note: The most common processor architectures are: 64-bit (x86-64, IA64 and AMD64) and 32-bit (x86). i686 is part of the x86 family, which is 32-bit.

2. Using the uname command

Uname provides your Linux system information and the kernel version. Run the following command to get CPU information with the uname command.

$ uname -m

Sample output:

x86_64

In this example the Linux system runs on a 64-bit CPU.

3. Using lshw command

Lshw is a simple command for listing hardware information of your Linux system. You can get Linux CPU information by running the following command:

$ sudo lshw -c cpu

You will receive the output in your terminal as:


Use the lshw command to get CPU information

You can filter further with the grep command, enter:

$ sudo lshw -c cpu | grep width

4. Get it from / proc / cpuinfo

On Linux, / proc / cpuinfo saves CPU information in a plain text file. In your Linux terminal, run the following grep command.

$ sudo grep -o -w 'lm' /proc/cpuinfo | sort -u

You will get the following output in your terminal:

lm

the lm flag refers to the long mode CPU, which is 64 bit. For more CPU information, you can run the following command:

$ cat /proc/cpuinfo

diploma

In this article, you learned how to use various command line tools to determine whether you are using a 32/64 bit CPU in your Linux machine.