Use Arch Command To Find Out Computer's Architecture Type

arch and uname
arch and uname.

In theory, you should already know the architecture of your computer because, after all, you installed Linux on it in the first place.

Of course, it could be the case that you didn't install Linux on the computer and you need to know the architecture before compiling a package to run on it.

You might think that the type of architecture is obvious, but when you take Chromebooks into consideration there is a possibility it is either x86_64 or arm based, and it isn't necessarily clear just by looking at a computer whether it is 32-bit or 64-bit.

Architecture Types

So what types are there? Well just checking out the Debian downloads page lists the following architectures:

  • amd64
  • arm64
  • armel
  • armhf
  • i386
  • mips
  • mipsel
  • powerpc
  • ppc64el
  • s390ex

Other potential architectures include i486, i586, i686, ia64, alpha and sparc.

The following command will show you the architecture for your computer:

arch

In essence the arch command is a simple way of expressing the following command:

uname -m

uname is used to print all sorts of system information about your computer of which the architecture type is just a small part.

Simply typing uname on its own shows you the operating system you are running, i.e. Linux whereas uname -a displays all the information available from the uname command including the following:

  • kernel name
  • node name
  • kernel release
  • kernel version
  • machine hardware (i.e. same as arch command)
  • processor
  • hardware platform
  • operating system

You can use switches to specify just the information you want to show.

  • uname -a - shows all information
  • uname -s - shows the kernel (i.e. Linux)
  • uname -n - shows the network host name (i.e. localhost.localdomain)
  • uname -r - shows the kernel release (i.e. 3.10.0-229.14.1.e17.x86_64
  • uname -v - shows the kernel version (i.e. #1 SMP Tue Sep 15 15:05:51 UTC 2015)
  • uname -m - shows the architecture (i.e x86_64)
  • uname -p - shows the processor type (i.e x86_64)
  • uname -i - hardware platform (i.e. x86_64)
  • uname -o - operating system

You can see the full manual for uname and arch by typing the following command:

info coreutils 'uname invocation'

It is also possible to get full details of the arch command by typing man arch.

The arch command itself has only 2 switches:

  • arch --help - display the help page
  • arch --version - display the version number

To complete this guide the following command will also show you whether your system is running 32-bit or 64-bit:

  • getconf LONG_BIT

getconf actually stands for get configuration value. It is part of the POSIX programmers manual. The LONG_BIT returns the size of a long integer. If it returns 32 then you have a 32-bit system whereas if it returns 64 you have a 64-bit system.

This method isn't fool proof however and it may not work on all architectures.

For full details about the getconf command type man getconf into a terminal window or visit this webpage.

Whilst it is obviously easier to type arch than uname -m it is worth noting that the arch command has been deprecated and may not be available on all versions of Linux in the future. You should therefore get used to using the uname command instead.