logo
logo
  • Home
  • Power Sources and Cables
  • Phones
  • Office Tech
  • Smart Home Devices
  • Wearable Tech
  • Rising Tech
  • Computers

How to Check Your CPU’s Architecture on Linux

Omair Khaliq Sultan
Written By Omair Khaliq Sultan
Original Publish Date: Oct 20, 2024, 04:53 PM
Last updated: Nov 10, 2024, 08:54 PM
Disclosure ↓
How to Check Your CPU's Architecture on Linux
View all Contents
  • 1. Using the uname Command
  • 2. Using the lscpu Command for Detailed Information
  • 3. Checking CPU Architecture with the file Command
  • 4. Using /proc/cpuinfo for CPU Details
  • 5. Using dpkg on Debian-Based Systems
  • Summary of Commands
  • Conclusion
Knowing your CPU’s architecture is essential for tasks like installing the correct software packages, choosing the right OS version, or ensuring hardware compatibility. In Linux, you can quickly check whether your CPU is 32-bit, 64-bit, ARM, or another type by using a few straightforward terminal commands. Here’s a guide to help you determine your CPU’s architecture on any Linux distribution.

1. Using the uname Command

The uname command is one of the simplest and quickest ways to get basic information about your CPU architecture.

  1. Open a terminal window.
  2. Type the following command and press Enter:
    uname -m
  3. You’ll see an output like:
    • x86_64: 64-bit architecture
    • i686 or i386: 32-bit architecture
    • armv7l or aarch64: ARM architecture (32-bit or 64-bit, respectively)

This command provides the machine hardware name, which gives you a direct answer about your CPU architecture.

2. Using the lscpu Command for Detailed Information

The lscpu command offers more detailed information about the CPU, including architecture, model name, cores, and more.

  1. Open the terminal.
  2. Run the following command:
    lscpu
  3. In the output, look for the Architecture line, which indicates the CPU’s architecture:
    • x86_64: 64-bit
    • i686 or i386: 32-bit
    • aarch64 or arm: ARM architecture

The lscpu command also provides additional details like the number of CPU cores, the CPU model, and the vendor, which can be helpful for understanding your system’s specifications in detail.

3. Checking CPU Architecture with the file Command

The file command can tell you the architecture of the binaries on your system, which indirectly indicates the system architecture.

  1. Open a terminal.
  2. Use the following command to check the architecture of the bash binary:
    file /bin/bash
  3. You should see output similar to:
    • ELF 64-bit: 64-bit architecture
    • ELF 32-bit: 32-bit architecture

This command provides a quick way to confirm the CPU’s architecture based on the type of binaries your system is running.



4. Using /proc/cpuinfo for CPU Details

The /proc/cpuinfo file contains detailed information about your CPU. While it doesn’t explicitly state the CPU architecture, you can infer it by reviewing certain details.

  1. In the terminal, enter:
    cat /proc/cpuinfo
  2. Look through the output for the flags section:
    • If you see lm (long mode), it indicates 64-bit capability.
    • The flags section may also include other relevant information like vmx (Intel Virtualization) or svm (AMD Virtualization).

This method provides a lot of information, which can be useful if you’re also interested in other CPU specifications beyond architecture.

5. Using dpkg on Debian-Based Systems

On Debian-based distributions like Ubuntu, you can use the dpkg command to check your system’s architecture.

  1. In the terminal, enter:
    dpkg --print-architecture
  2. The output will indicate your system architecture:
    • amd64 for 64-bit
    • i386 for 32-bit
    • armhf or arm64 for ARM architecture

This command is specific to Debian-based systems and won’t work on other Linux distributions.

Summary of Commands

CommandOutputArchitecture
uname -mx86_64, i686, armv7l, aarch64Basic architecture info
lscpuArchitecture: x86_64, etc.Detailed CPU info
file /bin/bashELF 64-bit or ELF 32-bitArchitecture via binary type
cat /proc/cpuinfoflags: lm (for 64-bit)CPU details in /proc filesystem
dpkg --print-architectureamd64, i386, arm64For Debian-based systems only

Conclusion

Each of these commands provides a way to check your CPU’s architecture on Linux, whether you want a quick overview or a detailed look. Using a combination of these commands can give you a comprehensive understanding of your system’s architecture and other specifications.

Your Trust, Our Core Commitment

At Rising Tech, earning and maintaining your trust is the cornerstone of our mission. We're dedicated to transparency, impartiality, and the relentless pursuit of truth in every article, review, and recommendation we publish. Our commitment to these principles ensures that you, our valued reader, are always equipped with reliable and unbiased information. Let us be your trusted guide in the ever-evolving world of technology.

Contributors

Omair Khaliq Sultan
Omair Khaliq Sultan
Omair is a certified strength coach with a specialization in Powerlifting-style training and sports rehab. He also has a keen interest in tech, music, and cooking. When he's not working, you'll probably find him lifting weights, noodling on his guitar, perfecting his smash burger recipe, or watching tech reviews on YouTube.
Computers FAQ Guides
Related Reads
  • How To Scan a Document to Email: A Step-by-Step Guide
  • How to Connect Your Android to Your Laptop
  • Hybrid Work Model: 5 Essentials for Working Between Home and the Office
  • 6 Must-Have Laptop Accessories That Increase Privacy and Security
  • 8 Computer Setups for Home Office Techies
Back to top
logo

©2025. All Rights Reserved

  • About Us
  • FAQ
  • Contact Us
  • Privacy
  • Terms
Contact

contact@risingtech.org

We independently research, test, review, and recommend the best products. If you buy something through our links, we may earn a commission at no cost to you. Click here to learn more about our process.