1.2 KiB
1.2 KiB
title, source, author, published, created, description, tags
| title | source | author | published | created | description | tags | |
|---|---|---|---|---|---|---|---|
| shenwei |
|
#linux
要判别你的 Linux 服务器是 x64(也就是 x86_64)还是 ARM64,可以通过多种方式,以下是最常用的方法:
1. 使用 uname 命令
uname -m
-
输出结果示例:
x86_64→ 表示 64位 x86(Intel/AMD)架构aarch64→ 表示 64位 ARM 架构armv7l→ 表示 32位 ARM 架构
2. 使用 lscpu 命令
lscpu
- 会输出详细 CPU 架构信息,例如:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
Architecture字段直接告诉你 CPU 类型。
3. 查看 /proc/cpuinfo
cat /proc/cpuinfo
- x86_64 CPU 会有
model name类似 “Intel(R) Xeon(R) CPU …” - ARM64 CPU 会显示
AArch64或ARMv8等信息。
4. 使用 file 命令检测可执行文件
file /bin/bash
- 输出示例:
/bin/bash: ELF 64-bit LSB executable, x86-64→ x64/bin/bash: ELF 64-bit LSB executable, ARM aarch64→ ARM64