arch command is a Linux command that displays the hardware architecture type of the current host. It is useful when you need to know the type of CPU architecture your Linux system is running on, especially when you need to install software packages or drivers that are specific to your system’s architecture.
arch command is very simple to use. To display the hardware architecture type of the current host, simply open a terminal and type:
The output of the command will be the hardware architecture type of your system, which will be one of the following:
- x86_64 (64-bit Intel/AMD)
- i686 (32-bit Intel/AMD)
- armv6l (Raspberry Pi 1)
- armv7l (Raspberry Pi 2/3)
- aarch64 (64-bit ARM)
- ppc64le (POWER8/POWER9 Little Endian)
- s390x (IBM System z)
Here are some examples of how you can use the
- To check if your system is running on a 64-bit or 32-bit architecture:
if [ $(arch) == "x86_64" ]; then echo "64-bit"; else echo "32-bit"; fi
- To download a package that is specific to your system’s architecture:
- To check if a binary is compatible with your system’s architecture:
file /path/to/binary | grep $(arch)
arch command does not have any options or arguments.
arch command does not display the correct hardware architecture type of your system, it is possible that your system is running on a different architecture type that is not supported by the
arch command. In this case, you can try using the
uname -m command instead, which will display the machine hardware name of your system.
archcommand only displays the hardware architecture type of the current host and does not provide any information about the operating system or distribution.
archcommand is available on all Linux distributions and does not require any special permissions to run.