如何在 Linux 中查看系统硬件制造商、型号和序列号 | Linux 中国

找不到分类 evilven 3个月前 (03-07) 24次浏览 未收录 0个评论 扫描二维码
如何在 Linux 中查看系统硬件制造商、型号和序列号 | Linux 中国

对于 Linux 图形界面用户和 Windows 用户来说获取系统硬件信息都不算问题,但是对命令行用户来说想要获取这些细节时有点儿麻烦。
— Vinoth Kumar


致谢
编译自 | 
https://www.2daygeek.com/how-to-check-system-hardware-manufacturer-model-and-serial-number-in-linux/
 
 作者 | Vinoth Kumar
 译者 | Luke (icecoobe) 🌟🌟共计翻译:3 篇 贡献时间:950 天

对于 Linux 图形界面用户和 Windows 用户来说获取系统硬件信息都不算问题,但是对命令行用户来说想要获取这些细节时有点儿麻烦。

甚至我们中的大多数都不知道获取这些信息最好的命令是什么。Linux 中有许多可用的工具集来获取诸如制造商、型号和序列号等硬件信息。

在这里我尝试写下获取这些细节的可能的方式,你可以挑选一种最好用的。

你必须知道所有这些信息,因为当你向硬件制造商提交任何硬件问题时,你会需要它们。

这可以通过 6 种方法来实现,下面我来演示一下怎么做。

方法一:使用 dmidecode 命令

dmidecode 是一个读取电脑 DMI(桌面管理接口Desktop Management Interface)表内容并且以人类可读的格式显示系统硬件信息的工具。(也有人说是读取 SMBIOS —— 系统管理 BIOSSystem Management BIOS

这个表包含系统硬件组件的说明,也包含如序列号、制造商、发布日期以及 BIOS 修订版本号等其它有用的信息。

DMI 表不仅描述了当前的系统构成,还可以报告可能的升级信息(比如可以支持的最快的 CPU 或者最大的内存容量)。

这将有助于分析你的硬件兼容性,比如是否支持最新版本的程序。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> dmidecode </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">t system</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> dmidecode </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2.12</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> SMBIOS entry point at </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0x7e7bf000</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">SMBIOS </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2.7</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> present</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Handle</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0x0024</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> DMI type </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">27</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> bytes</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Information</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Manufacturer</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> IBM</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Product</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Name</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> x2530 M4</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-[</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1214AC1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]-</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Version</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0B</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Serial</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Number</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> MK2RL11</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> UUID</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">762A99BF</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">6916</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">450F</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">80A6</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">B2E9E78FC9A1</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Wake</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">up </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Type</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Power</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Switch</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> SKU </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Number</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Not</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Specified</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Family</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> X</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Handle</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0x004B</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> DMI type </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">12</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">5</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> bytes</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Configuration</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Options</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Option</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> JP20 pin1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> TPM PP </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Disable</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> pin2</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">3</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> TPM PP </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Enable</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Handle</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0x004D</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> DMI type </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">32</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">,</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">20</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> bytes</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Boot</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Information</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Status</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">No</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> errors detected</span></code></p></li>
</ol>

推荐阅读: Dmidecode –– 获取 Linux 系统硬件信息的简单方式[1]

方法二:使用 inxi 命令

inxi 是 Linux 上查看硬件信息的一个灵巧的小工具,它提供了大量的选项来获取所有硬件信息,这是我在现有的其它 Linux 工具集里所没见到过的。它是从 locsmif 编写的古老的但至今看来都异常灵活的 infobash fork 出来的。

inxi 是一个可以快速显示系统硬件、CPU、驱动、Xorg、桌面、内核、GCC 版本、进程、内存使用以及大量其它有用信息的脚本,也可以用来做技术支持和调试工具。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> inxi </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">M</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Machine</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Device</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> server </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> IBM product</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> N</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">A v</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0B</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> serial</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> MK2RL11</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Mobo</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> IBM model</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">00Y8494</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> serial</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">37M17D</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> UEFI</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> IBM v</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-[</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">VVE134MUS</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1.50</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">date</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">08</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">30</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2013</span></code></p></li>
</ol>

推荐阅读: inxi —— 一个很棒的查看 Linux 硬件信息的工具[2]

方法三:使用 lshw 命令

lshw(指硬件监听器Hardware Lister)是一个小巧灵活的工具,可以生成如内存配置、固件版本、主板配置、CPU 版本和速度、缓存配置、USB、网卡、显卡、多媒体、打印机以及总线速度等机器中各种硬件组件的详细报告。

它通过读取 /proc 目录下各种文件的内容和 DMI 表来生成硬件信息。

lshw 必须以超级用户的权限运行来检测完整的硬件信息,否则它只汇报部分信息。lshw 里有一个叫做 class 的特殊选项,它可以以详细的模式显示特定的硬件信息。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> lshw </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">C system</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">enal</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dbo01t</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> description</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">Blade</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> product</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> x2530 M4</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-[</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1214AC1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]-</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> vendor</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> IBM</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> version</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">0B</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> serial</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> MK2RL11</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> width</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">64</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> bits</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> capabilities</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> smbios</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2.7</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> dmi</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2.7</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> vsyscall32</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> configuration</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> boot</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">normal chassis</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">enclosure family</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> X uuid</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">762A99BF</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">6916</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">450F</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">80A6</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">B2E9E78FC9A1</span></code></p></li>
</ol>

推荐阅读: LSHW (Hardware Lister) –– 获取 Linux 硬件信息的灵巧的小工具[3]

方法四:使用 /sys 文件系统

内核在 /sys 目录下的文件中公开了一些 DMI 信息。因此,我们可以通过如下方式运行 grep 命令来轻易地获取机器类型。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;"><li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">grep</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">""</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sys</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">class</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dmi</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">id</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/[</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">pbs</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]*</span></code></p></li></ol>

或者,可以使用 cat 命令仅打印出特定的详细信息。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cat</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sys</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">class</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dmi</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">id</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">board_vendor</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">IBM</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cat</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sys</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">class</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dmi</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">id</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">product_name</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> x2530 M4</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-[</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1214AC1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]-</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cat</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sys</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">class</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dmi</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">id</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">product_serial</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">MK2RL11</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">cat</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">sys</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">class</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">dmi</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">id</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">bios_version</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-[</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">VVE134MUS</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1.50</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]-</span></code></p></li>
</ol>

方法五:使用 dmesg 命令

dmesg 命令是在 Linux 上 syslogd 或 klogd 启动前用来记录内核消息(启动阶段的消息)的。它通过读取内核的环形缓冲区来获取数据。在排查问题或只是尝试获取系统硬件信息时,dmesg 非常有用。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">dmesg</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">|</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="kwd" style="word-wrap: break-word;color: rgb(226, 137, 100);">grep</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">i DMI</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">DMI</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="typ" style="word-wrap: break-word;color: rgb(137, 189, 255);">System</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> x2530 M4</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">:</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">-[</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">1214AC1</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">]-</span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">/00Y8494, BIOS -[VVE134MUS-1.50]- 08/</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">30</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">/</span><span class="lit" style="word-wrap: break-word;color: rgb(51, 135, 204);">2013</span></code></p></li>
</ol>

方法六:使用 hwinfo 命令

hwinfo硬件信息hardware information)是另一个很棒的工具,用于检测当前系统存的硬件,并以人类可读的方式显示各种硬件模块的详细信息。

它报告关于 CPU、内存、键盘、鼠标、显卡、声卡、存储、网络接口、磁盘、分区、BIOS 以及桥接器等信息。它可以比其它像 lshwdmidecode 或 inxi 等工具显示更为详细的信息。

hwinfo 使用 libhd 库 libhd.so 来收集系统上的硬件信息。该工具是为 openSuse 特别设计的,后来其它发行版也将它包含在其官方仓库中。

<ol class="linenums list-paddingleft-2" style="margin-left: 2em;margin-right: 2em;">
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="com" style="word-wrap: break-word;color: rgb(174, 174, 174);font-style: italic;">#</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> hwinfo </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">|</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> egrep </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">"system.hardware.vendor|system.hardware.product"</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> system</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">hardware</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">vendor </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">'IBM'</span></code></p></li>
<li><p><code style="word-wrap: break-word;background: none;color: rgb(33, 150, 243);line-height: 1.2em;padding-left: 10px !important;border-radius: 0px !important;margin-top: 1em !important;margin-bottom: 1em !important;border-width: initial !important;border-style: none !important;border-color: initial !important;"><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> system</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">hardware</span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">.</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);">product </span><span class="pun" style="word-wrap: break-word;color: rgb(184, 255, 184);">=</span><span class="pln" style="word-wrap: break-word;color: rgb(184, 255, 184);"> </span><span class="str" style="word-wrap: break-word;color: rgb(101, 176, 66);">'System x2530 M4: -[1214AC1]-'</span></code></p></li>
</ol>

推荐阅读: hwinfo (Hardware Info) –– 一款灵活的检测 Linux 系统硬件信息的工具[4]


via: https://www.2daygeek.com/how-to-check-system-hardware-manufacturer-model-and-serial-number-in-linux/

作者:VINOTH KUMAR[6] 选题:lujun9972 译者:icecoobe 校对:pityonline

本文由 LCTT 原创编译,Linux中国 荣誉推出


Hacking For Fun , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Linux 中查看系统硬件制造商、型号和序列号 | Linux 中国
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址