How to get linux architecture

How to find the processor / chip architecture on Linux

uname -m gives you back i686 or x86_64 depending on 32-bit or 64-bit Intel CPU, but I don’t have access to machines on non-Intel architectures.

x86_64 or amd64 would be 64-bit. i386, i486, i586, and i686 are 32-bit. Keep in mind however that those values are merely a reflection of the target the kernel was compiled for and not necessarily what the CPU is capable of.

6 Answers 6

To display kernel architecture: uname -p

To display extended CPU details: cat /proc/cpuinfo

uname (with any options) will only show the kernel architecture, not the physical CPU architecture. In other words, it will show which CPU the kernel was compiled for. But that could show i386 even when running on a x86_64 CPU.

which returns output like this:

Architecture: i686 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 2 On-line CPU(s) list: 0,1 Thread(s) per core: 1 Core(s) per socket: 2 Socket(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 23 Stepping: 6 CPU MHz: 2670.000 BogoMIPS: 5320.13 L1d cache: 32K L1i cache: 32K L2 cache: 3072K 

To only get the architecture:

I’m surprised no one suggested uname -m . On my laptop, this gives armv7l , while uname -a gives me a monstrous two lines of text.

A concise command producing information about the current machine is hostnamectl . Example output:

Static hostname: xxxx Icon name: computer-laptop Chassis: laptop Boot ID: b3a1f952c514411c8c4xxxxxxxxxxxx Operating System: Ubuntu 14.04.3 LTS Kernel: Linux 3.19.0-43-generic Architecture: x86_64 

It gives you the most basic information about your machine. Other commands like uname , lsb_release , or lscpu return more specific information.

Источник

5 Command Line Ways to Find Out Linux System is 32-bit or 64-bit

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.

Читайте также:  Compiling freebsd on linux

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:

If your OS is 32-bit, then the output will be:

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.

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.

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.

A Linux Consultant, living in India. He loves very much to write about Linux, Open Source, Computers and Internet. Apart from that, He’d like to review Internet tools and web services.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Parted Command in Linux

TLDR Man Pages for Linux Commands

apt-get Command Examples

Ubuntu apt-cache Commands

apt Command Examples

Funny Linux Commands

11 thoughts on “5 Command Line Ways to Find Out Linux System is 32-bit or 64-bit”

I’d just like to interject for a moment. What you’re referring to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called “Linux”, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called “Linux” distributions are really distributions of GNU/Linux. Reply

Читайте также:  Run windows on linux machine

Great post! You can also check using a environment variable: echo $HOSTTYPE Result: i386 -> 32 bits
x86_64 -> 64 bits Reply

Источник

How to Determine Kernel Architecture in Linux

kernel architecture in linux

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.

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.

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.

Источник

How to find architecture of my PC and Ubuntu?

Can someone please explain to me why both i386 & i686 ? What exactly is my PC architecture and what version of Ubuntu am I using (32bit or 64bit)?

is this a complete output from uname -a? I assume some fields like the kernel-name, kernel-version etc are missing.

5 Answers 5

Open a terminal try using uname -m command. This should show you the OS architecture.

If it gives any output like ix86 , where x is 3,4,5 or 6, Your OS is 32bit.

Читайте также:  Linux создать iso папки

You can also see the Ubuntu architecture by Opening «System monitor» and going in the System tab.

enter image description here

Difference between hardware platform and Processor type:

There is a difference between the hardware platform (which is given by -i switch) to the CPU type (given by -p switch).

The hardware platform tells us which architecture the kernel is built for (may be optimized though for later versions). It can be a i386.

However the Processor type refers to the actual processor type of your machine such as i686 (P4 and later builds).

Thanks to Schotty of this this page. Here is an answer from Unix stackexchange site on the same topic, though I didn’t find the language enough clear (completely my fault).

On uname -m , it says i686,what does this mean? and my system monitor window says «Release 11.10(oneiric) Kernel Linux 3.0.0-26-generic GNOME 3.2.1» It doesn’t specifies any thing,like one shown in your pic.

@Ubunu_beginner, i386 and i686 are both part of the x86 family of processors. They just refer to the specific age of the processor platform. i386 is an older platform (early 90s?) used back when 386 processors were used in machines. Then this was upgraded to 486 processors, which was the same basic instruction set as 386 just faster and newer. 586 was another upgraded and was when the term Pentium started floating around. Eventually all of these got encapsulated into the x86 architecture name. i686 just refers to the 6th generation of x86 architecture.

@frank Thank you. Actually it was the gnome-system-monitor before gnome migrated to version 3. And I forgot the theme name. But You can use same system monitor by installing mate-system-monitor application

Use Anwar’s answer to find the architecture.

Now here is the explanation for your second part of the question.

Below is the uname output: In my case I have installed a 32 bit version. Both i386 and i686 refer 32 bit version. uname will return x86_64 in case if it is a 64 bit version.

$ uname -a Linux devav2 3.2.0-30-generic-pae #48-Ubuntu SMP Fri Aug 24 17:14:09 UTC 2012 i686 i686 i386 GNU/Linux 
  • Linux(-s) — OS/Kernel name
  • devav2(-n) — hostname
  • 3.2.0-30-generic-pae (-r) — kernel release
  • 48-Ubuntu SMP Fri Aug 24 17:14:09 UTC 2012 (-v) — Kernel version with time and SMP stands for symmetric multiprocessing, which means you have multiprocessor support
  • i686(-m) — Machine hardware name
  • i686(-p) — processor type
  • i386(-i) — hardware platform
  • GNU/LINUX(-o) — Operating System name

Below is grabbed from uname —help page which might help you to understand more about it.

 -a, --all print all information, in the following order, except omit -p and -i if unknown: -s, --kernel-name print the kernel name -n, --nodename print the network node hostname -r, --kernel-release print the kernel release -v, --kernel-version print the kernel version -m, --machine print the machine hardware name -p, --processor print the processor type or "unknown" -i, --hardware-platform print the hardware platform or "unknown" -o, --operating-system print the operating system 

Источник

Оцените статью
Adblock
detector