查看当前计算机CPU架构

在安装软件的时候,windows上会有 32bit, 64bit 的区别,但是Linux系统下则还需要知道CPU架构,比如 amd64, i386, arm64, x86_64, aarch64 等等。

1、cat /proc/version
Linux version 3.10.0-1127.10.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 
20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Wed Jun 3 14:28:03 UTC 2020

2、uname -a
Linux localhost.localdomain 3.10.0-1127.10.1.el7.x86_64 #1 SMP Wed Jun 3 14:28:03 UTC 2020 x86_64 
x86_64 x86_64 GNU/Linux

3、file /bin/bash
/bin/bash: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs)
, for GNU/Linux 2.6.32, BuildID[sha1]=85e3da5a087950e7aaeb7893c056218a8874d2e5, stripped

4、arch
x86_64

说明
aarch64, arm64 – ARM架构
x86_64,x64,AMD64 – X86架构
mips – MIPS架构