Files
nexus/raw/Home Office/如何判别你的Linux 服务器是 x64(也就是 x86_64)还是 ARM64.md

63 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title:
source:
author: shenwei
published:
created:
description:
tags: [linux]
---
#linux
要判别你的 Linux 服务器是 x64也就是 x86_64还是 ARM64可以通过多种方式以下是最常用的方法
---
### 1. 使用 `uname` 命令
``` bash
uname -m
```
- 输出结果示例:
- `x86_64` → 表示 **64位 x86Intel/AMD架构**
- `aarch64` → 表示 **64位 ARM 架构**
- `armv7l` → 表示 **32位 ARM 架构**
---
### 2. 使用 `lscpu` 命令
``` bash
lscpu
```
- 会输出详细 CPU 架构信息,例如:
``` bash
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
[[🟠Linux 运维必会的 150 个命令]]