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

当运行uname -a ,我得到输出

 41-Ubuntu SMP Mon Aug 13 17:59:54 UTC 2012 i686 athlon i386 GNU/Linux 

有人可以向我解释为什么i386和i686

我的PC架构究竟是什么以及我使用的是什么版本的Ubuntu(32位或64位)?

命令是uname -m

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

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

您还可以通过打开“系统监视器”并进入“系统”选项卡来查看Ubuntu体系结构。

在此处输入图像描述

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

硬件平台(由-i开关给出)与CPU类型(由-p开关给出)之间存在差异。

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

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

感谢此页面的 Schotty。 这是来自Unix stackexchange网站的同一主题的答案 ,虽然我没有找到足够清晰的语言(完全是我的错)。

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

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

下面是uname输出:在我的情况下,我安装了32位版本。 i386和i686都是32位版本。 如果它是64位版本,则uname将返回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 
  • Linux(-s) – OS /内核名称
  • devav2(-n) – 主机名
  • 3.2.0-30-generic-pae(-r) – 内核发布
  • 48-Ubuntu SMP Fri 8月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 

如果你想要的只是架构,你可以随时尝试名为arch的命令。 这很简洁。 它不是POSIX 。

使用来自Formake项目的syscap https://sourceforge.net/projects/formake syscap允许探测许多系统属性和测试依赖项。 它是一个可移植的shell脚本。