如何使用 inxi 查找 Linux 系统详细信息

印西 是一个免费的、开源的、功能齐全的命令行系统信息工具。 它显示系统硬件、CPU、驱动程序、Xorg、桌面、内核、GCC 版本、进程、RAM 使用情况以及各种其他有用信息。 无论是硬盘还是CPU,主板还是整个系统的完整细节,inxi都会在几秒钟内更准确地显示出来。 由于它是 CLI 工具,您可以在桌面版或服务器版中使用它。 Inxi 在大多数 Linux 发行版和一些 BSD 系统的默认存储库中都可用。

安装 inxi

在 Arch Linux 及其衍生产品上:

要在 Arch Linux 或其衍生产品(如 Antergos 和 Manajaro Linux)中安装 inxi,请运行:

$ sudo pacman -S inxi

如果 Inxi 在默认存储库中不可用,请尝试使用任何 AUR 帮助程序从 AUR 安装它(每年都不同)。

使用

$ yay -S inxi

在 Debian / Ubuntu 和衍生产品上:

$ sudo apt-get install inxi

在 Fedora / RHEL / CentOS / 科学Linux:

inxi 可在 Fedora 默认存储库。 因此,只需运行以下命令即可立即安装它。

$ sudo dnf install inxi

在 RHEL 及其克隆(如 CentOS 和 Scientific Linux)中,您需要添加 EPEL 存储库,然后安装 inxi。

要安装 EPEL 存储库,只需运行:

$ sudo yum install epel-release

安装 EPEL 存储库后,使用命令安装 inxi:

$ sudo yum install inxi

在 SUSE/openSUSE 上:

$ sudo zypper install inxi

使用 inxi 查找 Linux 系统详细信息

inxi 将需要一些额外的程序才能正常运行。 它们将与 inxi 一起安装。 但是,如果它们没有自动安装,您需要找到并安装它们。

要列出所有必需的程序,请运行:

$ inxi --recommends

如果您发现任何缺少的程序,请在开始使用 inxi 之前安装它们。

现在,让我们看看如何使用它来揭示 Linux 系统的详细信息。 inxi 的使用非常简单直接。

打开终端并运行以下命令以打印 CPU、内存、硬盘驱动器和内核信息的简短摘要:

$ inxi

样本输出:

CPU: Dual Core Intel Core i3-2350M (-MT MCP-) speed/min/max: 798/800/2300 MHz 
Kernel: 5.1.2-arch1-1-ARCH x86_64 Up: 1h 31m Mem: 2800.5/7884.2 MiB (35.5%) 
Storage: 465.76 GiB (80.8% used) Procs: 163 Shell: bash 5.0.7 inxi: 3.0.34

使用 inxi 查找 Linux 系统详细信息

如您所见,Inxi 显示了我的 Arch Linux 桌面的以下详细信息:

  1. CPU类型,
  2. CPU速度,
  3. 内核细节,
  4. 正常运行时间,
  5. 内存详细信息(总内存和已用内存),
  6. 硬盘大小以及当前使用情况,
  7. 过程,
  8. 默认外壳详细信息,
  9. 印西版。

要显示完整摘要,请使用 “-F” 如下图切换。

$ inxi -F

样本输出:

System:    Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux 
Machine:   Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: <root required> 
           Mobo: Dell model: 01HXXJ v: A05 serial: <root required> BIOS: Dell v: A05 date: 08/03/2012 
Battery:   ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%) 
CPU:       Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB 
           Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798 
Graphics:  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz 
           Message: Unable to show advanced data. Required tool glxinfo missing. 
Audio:     Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel 
           Sound Server: ALSA v: k5.1.2-arch1-1-ARCH 
Network:   Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 
           IF: enp5s0 state: down mac: 45:c8:gh:89:b6:45 
           Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k 
           IF: wlp9s0 state: up mac: c3:11:96:22:87:3g
           Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb 
Drives:    Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) 
           ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB 
Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 
           ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 
           ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3 
Sensors:   System Temperatures: cpu: 58.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 3445 
Info:      Processes: 169 Uptime: 1h 38m Memory: 7.70 GiB used: 2.94 GiB (38.2%) Shell: bash inxi: 3.0.34

IRC 上使用的 Inxi 会自动过滤掉您的网络设备 MAC 地址、WAN 和 LAN IP、分区中的 /home 用户名目录以及其他一些项目,以维护基本的隐私和安全。 您还可以使用 -z 选项如下。

$ inxi -Fz

要覆盖 IRC 过滤器,请使用 -Z 选项。

$ inxi -FZ

这对于在私人聊天中在线调试网络连接问题很有用,例如 example. 使用 -Z 选项时请非常小心。 它将显示您的 MAC 地址。 您不应该在公共论坛上分享使用 -Z 选项获得的结果。

显示特定于设备的详细信息

在没有任何选项的情况下运行 inxi 时,您将获得系统的基本详细信息,例如 CPU、内存、内核、正常运行时间、硬盘等。

当然,您可以使用各种选项缩小结果范围以显示特定设备的详细信息。 Inxi 有许多选项(大写和小写)。

首先,我们将看到 example 按字母顺序排列所有大写选项的命令。 某些命令可能需要 root/sudo 获取实际数据的权限。

大写选项

1.显示音频/声卡详细信息

要使用声卡驱动程序显示您的音频和声卡信息,请使用 -一种 选项。

$ inxi -A
Audio:     Device-1: Intel 6 Series/C200 Series Family High Definition Audio driver: snd_hda_intel 
           Sound Server: ALSA v: k5.1.2-arch1-1-ARCH

2.显示电池详细信息

要显示系统当前电量和状况的电池详细信息,请使用 -B 选项。

$  inxi -B
Battery:   ID-1: BAT0 charge: 39.0 Wh condition: 39.0/48.8 Wh (80%)

3.显示CPU详细信息

要显示完整的 CPU 详细信息,包括内核数、CPU 型号、CPU 缓存、CPU 时钟速度、CPU 最小/最大速度等,请使用 -C 选项。

$ inxi -C
CPU:       Topology: Dual Core model: Intel Core i3-2350M bits: 64 type: MT MCP L2 cache: 3072 KiB 
           Speed: 798 MHz min/max: 800/2300 MHz Core speeds (MHz): 1: 798 2: 798 3: 798 4: 798

4.显示硬盘详情

要显示有关您的硬盘驱动器的信息,例如磁盘类型、供应商、设备 ID、型号、磁盘大小、总磁盘空间、使用百分比等,请使用 -D 选项。

$ inxi -D
Drives:    Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) 
           ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB

5.显示图形详细信息

要显示有关显卡的详细信息,包括显卡、驱动程序、供应商、显示服务器、分辨率等的详细信息,请使用 -G 选项。

$ inxi -G
Graphics:  Device-1: Intel 2nd Generation Core Processor Family Integrated Graphics driver: i915 v: kernel 
           Display: x11 server: X.Org 1.20.4 driver: modesetting unloaded: vesa resolution: 1366x768~60Hz 
           Message: Unable to show advanced data. Required tool glxinfo missing.

6. 显示有关进程、正常运行时间、内存、inxi 版本的详细信息

要显示有关进程数、总正常运行时间、已用内存的总内存、Shell 详细信息和 inxi 版本等信息,请使用 -一世 选项。

$ inxi -I
Info:      Processes: 170 Uptime: 5h 47m Memory: 7.70 GiB used: 3.27 GiB (42.4%) Shell: bash inxi: 3.0.34

7.显示主板详细信息

要显示有关您的机器详细信息、制造商、主板、BIOS 的信息,请使用 -M 选项。

$ inxi -M
Machine:   Type: Portable System: Dell product: Inspiron N5050 v: N/A serial: <root required> 
           Mobo: Dell model: 034ygt v: A018 serial: <root required> BIOS: Dell v: A001 date: 09/04/2015

8.显示网卡详细信息

要显示有关您的网卡的信息,包括供应商、网卡驱动程序和网络接口数量等,请使用 -N 选项。

$ inxi -N
Network:   Device-1: Realtek RTL810xE PCI Express Fast Ethernet driver: r8169 
           Device-2: Qualcomm Atheros AR9285 Wireless Network Adapter driver: ath9k 
           Device-3: Qualcomm Atheros AR3011 Bluetooth type: USB driver: btusb

如果要显示网卡的高级详细信息,例如 MAC 地址、速度和网卡状态,请使用 -n 选项。

$ inxi -n

请在公共论坛上谨慎分享此详细信息。

9.显示分区详情

要显示基本分区信息,请使用 -P 选项。

$ inxi -P
Partition: ID-1: / size: 456.26 GiB used: 376.25 GiB (82.5%) fs: ext4 dev: /dev/sda2 
           ID-2: /boot size: 92.8 MiB used: 62.9 MiB (67.7%) fs: ext4 dev: /dev/sda1 
           ID-3: swap-1 size: 2.00 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda3

要显示包括挂载点在内的完整分区信息,请使用 -p 选项。

$ inxi -p

10. 显示 RAID 详细信息

要显示 RAID 信息,请使用 -R 选项。

$ inxi -R

11.显示系统详情

要显示 Linux 系统信息,例如主机名、内核、DE、操作系统版本等,请使用 -S 选项。

$ inxi -S
System:    Host: sk Kernel: 5.1.2-arch1-1-ARCH x86_64 bits: 64 Desktop: Deepin 15.10.1 Distro: Arch Linux

12. 显示天气详情

Inix 不仅仅用于查找硬件细节。 它对于获取其他东西也很有用。

为了 example,您可以显示给定位置的天气详细信息。 为此,请运行 inxi -W 选项如下。

$ inxi -W 95623,us
Weather:   Temperature: 21.1 C (70 F) Conditions: Scattered clouds Current Time: Tue 11 Jun 2019 04:34:35 AM PDT 
           Source: WeatherBit.io

请注意,您应该在城市/州/国家/地区名称中仅使用 ASCII 字母以获得有效结果。

小写选项

1.显示基本系统详细信息

要仅显示系统详细信息的基本摘要,请使用 -b 选项。

$ inxi -b

或者,您可以使用以下命令:

两台服务器的目的相同。

$ inxi -v 2

2.设置配色方案

我们可以使用为 inxi 输出设置不同的配色方案 -C 选项。 Yu可以设置配色方案编号从 042. 如果没有提供方案编号, 0 假设。

这是有和没有的 inxi 输出 -C 选项。

无配色方案的 inxi 输出

如您所见,当我们使用 -c 选项运行 inxi 时,颜色方案被禁用。 在将没有转义码的干净输出重定向到文本文件时,-c 选项对于关闭彩色输出很有用。

同样,我们可以使用其他配色方案值。

$ inxi -c10
$ inxi -c42

3.显示光驱详情

我们可以使用以下方式显示光驱数据详细信息以及本地硬盘驱动器详细信息 -d 选项。

$ inxi -d
Drives:    Local Storage: total: 465.76 GiB used: 376.31 GiB (80.8%) 
           ID-1: /dev/sda vendor: Seagate model: ST9500325AS size: 465.76 GiB 
           Optical-1: /dev/sr0 vendor: PLDS model: DVD+-RW DS-8A8SH dev-links: cdrom 
           Features: speed: 24 multisession: yes audio: yes dvd: yes rw: cd-r,cd-rw,dvd-r,dvd-ram

4.显示所有CPU标志

要显示所有使用的 CPU 标志,请运行:

$ inxi -f

5.显示IP详细信息

要显示 WAN 和本地 IP 地址以及网卡详细信息,例如设备供应商、驱动程序、mac、状态等,请使用 -一世 选项。

$ inxi -i

6.显示分区标签

如果您为分区设置了标签,则可以使用查看它们 -l 选项。

$ inxi -l

您还可以使用以下命令查看所有分区的标签以及挂载点:

$ inxi -pl

7. 显示内存详情

使用 -m 选项。

$ sudo inxi -m
[sudo] password for sk: 
Memory:    RAM: total: 7.70 GiB used: 2.26 GiB (29.3%) 
           Array-1: capacity: 16 GiB slots: 2 EC: None 
           Device-1: DIMM_A size: 4 GiB speed: 1067 MT/s 
           Device-2: DIMM_B size: 4 GiB speed: 1067 MT/s

8.显示未挂载的分区详情

要显示未挂载的分区详细信息,请使用 -o 选项。

$ inxi -o

如果您的系统中没有未安装的分区,您将看到如下输出。

Unmounted: Message: No unmounted partitions found.

9. 显示仓库列表

要显示系统中的存储库列表,请使用 -r 选项。

$ inxi -r

样本输出:

 Repos: Active apt sources in file: /etc/apt/sources.list
 deb https://in.archive.ubuntu.com/ubuntu/ xenial main restricted
 deb https://in.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
 deb https://in.archive.ubuntu.com/ubuntu/ xenial universe
 deb https://in.archive.ubuntu.com/ubuntu/ xenial-updates universe
 deb https://in.archive.ubuntu.com/ubuntu/ xenial multiverse
 deb https://in.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
 deb https://in.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
 deb https://security.ubuntu.com/ubuntu xenial-security main restricted
 deb https://security.ubuntu.com/ubuntu xenial-security universe
 deb https://security.ubuntu.com/ubuntu xenial-security multiverse

建议阅读:

  • 如何在 Linux 中从命令行查找已安装存储库的列表

10.显示系统温度、风扇转速详情

Inxi 能够找到主板/CPU/GPU 温度和风扇速度。

$ inxi -s
Sensors:   System Temperatures: cpu: 60.0 C mobo: N/A 
           Fan Speeds (RPM): cpu: 3456

请注意,Inxi 需要传感器来查找系统温度。 确保 lm_sensors 已在您的系统中安装并正确配置。 有关 lm_sensors 的更多详细信息,请查看以下指南。

  • 如何在 Linux 上查看 CPU 温度

11.显示有关进程的详细信息

要显示消耗最多 CPU 和内存的前 5 个进程的列表进程,只需运行:

$ inxi -t
Processes: CPU top: 5 
           1: cpu: 14.3% command: firefox pid: 15989 
           2: cpu: 10.5% command: firefox pid: 13487 
           3: cpu: 7.1% command: firefox pid: 15062 
           4: cpu: 3.1% command: xorg pid: 13493 
           5: cpu: 3.0% command: firefox pid: 14954 
           System RAM: total: 7.70 GiB used: 2.99 GiB (38.8%) 
           Memory top: 5 
           1: mem: 1115.8 MiB (14.1%) command: firefox pid: 15989 
           2: mem: 606.6 MiB (7.6%) command: firefox pid: 13487 
           3: mem: 339.3 MiB (4.3%) command: firefox pid: 13630 
           4: mem: 303.1 MiB (3.8%) command: firefox pid: 18617 
           5: mem: 260.1 MiB (3.2%) command: firefox pid: 15062

我们还可以按 CPU 使用率或内存使用率对输出进行排序。

例如,要查找消耗内存最多的前 5 个进程,请使用以下命令:

$ inxi -t m
Processes: System RAM: total: 7.70 GiB used: 2.73 GiB (35.4%) 
           Memory top: 5 
           1: mem: 966.1 MiB (12.2%) command: firefox pid: 15989 
           2: mem: 468.2 MiB (5.9%) command: firefox pid: 13487 
           3: mem: 347.9 MiB (4.4%) command: firefox pid: 13708 
           4: mem: 306.7 MiB (3.8%) command: firefox pid: 13630 
           5: mem: 247.2 MiB (3.1%) command: firefox pid: 15062

要根据 CPU 使用率对前 5 个进程进行排序,请运行:

$ inxi -t c
Processes: CPU top: 5 
           1: cpu: 14.9% command: firefox pid: 15989 
           2: cpu: 10.6% command: firefox pid: 13487 
           3: cpu: 7.0% command: firefox pid: 15062 
           4: cpu: 3.1% command: xorg pid: 13493 
           5: cpu: 2.9% command: firefox pid: 14954

默认情况下,Inxi 将显示前 5 个进程。 您可以更改进程数,例如 example 10,如下图。

$ inxi -t cm10
Processes: CPU top: 10 
           1: cpu: 14.9% command: firefox pid: 15989 
           2: cpu: 10.6% command: firefox pid: 13487 
           3: cpu: 7.0% command: firefox pid: 15062 
           4: cpu: 3.1% command: xorg pid: 13493 
           5: cpu: 2.9% command: firefox pid: 14954 
           6: cpu: 2.8% command: firefox pid: 13630 
           7: cpu: 1.8% command: firefox pid: 18325 
           8: cpu: 1.4% command: firefox pid: 18617 
           9: cpu: 1.3% command: firefox pid: 13708 
           10: cpu: 0.8% command: firefox pid: 14427 
           System RAM: total: 7.70 GiB used: 2.92 GiB (37.9%) 
           Memory top: 10 
           1: mem: 1160.9 MiB (14.7%) command: firefox pid: 15989 
           2: mem: 475.1 MiB (6.0%) command: firefox pid: 13487 
           3: mem: 353.4 MiB (4.4%) command: firefox pid: 13708 
           4: mem: 308.0 MiB (3.9%) command: firefox pid: 13630 
           5: mem: 269.6 MiB (3.4%) command: firefox pid: 15062 
           6: mem: 249.3 MiB (3.1%) command: firefox pid: 14427 
           7: mem: 238.5 MiB (3.0%) command: firefox pid: 14954 
           8: mem: 208.2 MiB (2.6%) command: firefox pid: 18325 
           9: mem: 194.0 MiB (2.4%) command: firefox pid: 18617 
           10: mem: 143.6 MiB (1.8%) command: firefox pid: 23960

上面的命令将显示消耗最多 CPU 和内存的前 10 个进程。

要根据内存使用情况仅显示 top10,请运行:

$ inxi -t m10

12.显示分区UUID详细信息

显示分区 UUID (ü普遍地 ü唯一的 ID实体),使用 -u 选项。

$ inxi -u

还有更多的选择有待涵盖。 但是,这些足以获得 Linux 机器的几乎所有细节。

有关更多详细信息和选项,请参阅手册页。

$ man inxi

相关阅读:

  • 如何在 Linux 上查找硬件规格
  • 使用 Hwinfo 查找 Linux 系统硬件信息
  • Neofetch – 显示你的 Linux 系统信息
  • 使用 Python 查找 Linux 系统详细信息

Inxi 工具的主要目的是用于 IRC 或论坛支持。 如果您正在通过论坛或网站寻求任何帮助,其中有人询问您的系统规格,只需运行此命令,然后复制/粘贴输出。

资源:

感谢您的光临!

帮助我们帮助您:

祝你有美好的一天!!