如何找到我的 PC 和 Ubuntu 的架构?

Ubu*_*ner 73 versions architecture

运行时uname -a,我得到作为输出

41-Ubuntu SMP Mon Aug 13 17:59:54 UTC 2012 i686 athlon i386 GNU/Linux
Run Code Online (Sandbox Code Playgroud)

有人可以向我解释为什么同时使用 i386 和 i686吗?

我的 PC 架构到底是什么,我使用的是什么版本的 Ubuntu(32 位或 64 位)?

Anw*_*war 88

命令是uname -m.

打开终端尝试使用uname -m命令。这应该向您展示操作系统架构。

如果它给出任何输出ix86,其中 x 是 3、4、5 或 6,则您的操作系统是 32 位。

您也可以通过打开“系统监控”,并在会看到Ubuntu的架构系统选项卡。

在此处输入图片说明

硬件平台和处理器类型的区别

硬件平台(由-iswitch给出)与 CPU 类型(由-pswitch给出)之间存在差异。

硬件平台告诉我们内核是为哪种架构构建的(但可能会针对以后的版本进行优化)。它可以是 i386。

但是,处理器类型是指您机器的实际处理器类型,例如 i686(P4 和更高版本)。

感谢这个页面的Schotty 。这是来自 Unix stackexchange 站点的关于同一主题的答案,尽管我觉得语言不够清晰(完全是我的错)。

  • @Ubunu_beginner,i386 和 i686 都是 x86 系列处理器的一部分。它们只是指处理器平台的特定年龄。i386 是一个较旧的平台(90 年代初?),当时机器中使用 386 处理器。然后升级到 486 处理器,这是与 386 相同的基本指令集,只是更快、更新。586 是另一个升级版,是 Pentium 一词开始流行的时候。最终,所有这些都被封装到 x86 架构名称中。i686 只是指第 6 代 x86 架构。 (4认同)

dev*_*av2 22

使用 Anwar 的答案来查找架构。

现在这是对问题第二部分的解释。

下面是uname输出: 就我而言,我安装了 32 位版本。i386 和 i686 均指 32 位版本。uname如果是 64 位版本,将返回 x86_64。

$ uname -a
Linux devav2 3.2.0-30-generic-pae #48-Ubuntu SMP Fri Aug 24 17:14:09 UTC 2012 i686 i686 i386 GNU/Linux
Run Code Online (Sandbox Code Playgroud)
  • Linux(-s) - 操作系统/内核名称
  • devav2(-n) - 主机名
  • 3.2.0-30-generic-pae (-r) - 内核版本
  • 48-Ubuntu SMP Fri Aug 24 17:14:09 UTC 2012 (-v) - 内核版本与时间和 SMP 代表对称多处理,这意味着你有多处理器支持
  • i686(-m) - 机器硬件名称
  • i686(-p) - 处理器类型
  • i386(-i) - 硬件平台
  • GNU/LINUX(-o) - 操作系统名称

以下是从uname --help页面中截取的,可能有助于您了解更多相关信息。

 -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type or "unknown"
  -i, --hardware-platform  print the hardware platform or "unknown"
  -o, --operating-system   print the operating system
Run Code Online (Sandbox Code Playgroud)


Seb*_*bMa 6

适用于 debian Linux 派生系统。

在 64 位系统上:

$ dpkg-architecture -q DEB_BUILD_ARCH
amd64
Run Code Online (Sandbox Code Playgroud)

在 32 位系统上:

$ dpkg-architecture -q DEB_BUILD_ARCH
i386
Run Code Online (Sandbox Code Playgroud)

  • 为了避免安装“dpkg-dev”,您可以只运行“dpkg --print-architecture”。 (15认同)