如何在Linux系统中安装Inxi
Inix在大多数主流Linux分发存储库中可用,并且在BSD上运行。
$ sudo apt-get install inxi [On Debian/Ubuntu/Linux Mint]$ sudo yum install inxi [On CentOs/RHEL/Fedora]$ sudo dnf install inxi [On Fedora 22+]
在我们开始使用它之前,我们可以运行以下命令来检查所有应用程序依赖性,推荐和各种目录,并显示我们需要安装哪些软件包以添加对给定功能的支持。
$ inxi --recommends
inxi will now begin checking for the programs it needs to operate. First a check of the main languages and toolsinxi uses. Python is only for debugging data collection.---------------------------------------------------------------------------Bash version: 4.3.42(1)-releaseGawk version: 4.1.3,Sed version: Sudo version: 1.8.16Python version: 2.7.12---------------------------------------------------------------------------Test One: Required System Directories (Linux Only).If one of these system directories is missing, inxi cannot operate:/proc....................................................................... Present/sys........................................................................ PresentAll the directories are present.---------------------------------------------------------------------------Test Two: Required Core Applications.If one of these applications is missing, inxi cannot operate:df (info: partition data)................................................... /bin/dfgawk (info: core tool)...................................................... /usr/bin/gawkgrep (info: string search).................................................. /bin/greplspci (info: hardware data)................................................. /usr/bin/lspcips (info: process data)..................................................... /bin/psreadlink.................................................................... /bin/readlinksed (info: string replace).................................................. /bin/sedtr (info: character replace)................................................ /usr/bin/truname (info: kernel data)................................................... /bin/unamewc (info: word character count)............................................. /usr/bin/wcAll the applications are present.---------------------------------------------------------------------------Test Three: Script Recommends for Graphics Features.NOTE: If you do not use X these do not matter (like a headless server). Otherwise, if one of these applicationsis missing, inxi will have incomplete output:glxinfo (info: -G glx info)................................................. /usr/bin/glxinfoxdpyinfo (info: -G multi screen resolution)................................. /usr/bin/xdpyinfoxprop (info: -S desktop data)............................................... /usr/bin/xpropxrandr (info: -G single screen resolution).................................. /usr/bin/xrandrAll the applications are present.---------------------------------------------------------------------------Test Four: Script Recommends for Remaining Features.If one of these applications is missing, inxi will have incomplete output:dig (info: -i first wlan ip default test)................................... /usr/bin/digdmidecode (info: -M if no sys machine data; -m memory)...................... /usr/sbin/dmidecodefile (info: -o unmounted file system)....................................... /usr/bin/filehciconfig (info: -n -i bluetooth data)...................................... /bin/hciconfighddtemp (info: -Dx show hdd temp)........................................... /usr/sbin/hddtempifconfig (info: -i ip lan-deprecated)....................................... /sbin/ifconfigip (info: -i ip lan)........................................................ /sbin/ipsensors (info: -s sensors output)........................................... /usr/bin/sensorsstrings (info: -I sysvinit version)......................................... /usr/bin/stringslsusb (info: -A usb audio;-N usb networking)................................ /usr/bin/lsusbmodinfo (info: -Ax,-Nx module version)...................................... /sbin/modinforunlevel (info: -I runlevel)................................................ /sbin/runlevelsudo (info: -Dx hddtemp-user;-o file-user).................................. /usr/bin/sudouptime (info: -I uptime (check which package owns Debian)).................. /usr/bin/uptimeAll the applications are present.---------------------------------------------------------------------------Test Five: Script Recommends for Remaining Features.One of these downloaders needed for options -i/-w/-W (-U/-! [11-15], if supported):wget (info: -i wan ip;-w/-W;-U/-! [11-15] (if supported))................... /usr/bin/wgetcurl (info: -i wan ip;-w/-W;-U/-! [11-15] (if supported))................... /usr/bin/curlAll the applications are present.---------------------------------------------------------------------------Test Six: System Directories for Various Information.(Unless otherwise noted, these are for GNU/Linux systems)If one of these directories is missing, inxi may have incomplete output:/sys/class/dmi/id (info: -M system, motherboard, bios)...................... Present/dev (info: -l,-u,-o,-p,-P,-D disk partition data).......................... Present/dev/disk/by-label (info: -l,-o,-p,-P partition labels)..................... Present/dev/disk/by-uuid (info: -u,-o,-p,-P partition uuid)........................ PresentAll the directories are present.---------------------------------------------------------------------------Test Seven: System Files for Various Information.(Unless otherwise noted, these are for GNU/Linux systems)If one of these files is missing, inxi may have incomplete output:/proc/asound/cards (info: -A sound card data)............................... Present/proc/asound/version (info: -A ALSA data)................................... Present/proc/cpuinfo (info: -C cpu data)........................................... Present/etc/lsb-release (info: -S distro version data [deprecated])................ Present/proc/mdstat (info: -R mdraid data)......................................... Present/proc/meminfo (info: -I memory data)........................................ Present/etc/os-release (info: -S distro version data).............................. Present/proc/partitions (info: -p,-P partitions data).............................. Present/proc/modules (info: -G module data)........................................ Present/proc/mounts (info: -P,-p partition advanced data).......................... Present/var/run/dmesg.boot (info: -D,-d disk data [BSD only])...................... Missing/proc/scsi/scsi (info: -D Advanced hard disk data [used rarely])............ Present/var/log/Xorg.0.log (info: -G graphics driver load status).................. PresentThe following files are missing from your system:File: /var/run/dmesg.boot---------------------------------------------------------------------------All tests completed.
Inxi工具在Linux中的基本使用
下面是一些基本的Inxi选项,我们可以用来收集机器加系统信息。
显示Linux系统信息
当运行没有任何标志, Inxi将产生输出与系统CPU,内核,正常运行时间,内存大小,硬盘大小,进程数,客户端使用和inxi版本:
$ inxiCPU~Dual core Intel Core i5-4210U (-HT-MCP-) speed/max~2164/2700 MHz Kernel~4.4.0-21-generic x86_64 Up~3:15 Mem~3122.0/7879.9MB HDD~1000.2GB(20.0% used) Procs~234 Client~Shell inxi~2.2.35
显示Linux内核和分发信息
下面的命令将显示使用-S
标志的示例系统信息(主机名,内核信息,桌面环境和disto)
$ inxi -SSystem: Host: HowToing Kernel: 4.4.0-21-generic x86_64 (64 bit) Desktop: Cinnamon 3.0.7Distro: Linux Mint 18 Sarah
查找Linux笔记本电脑或PC型号信息
要打印机器数据 – 与产品详细信息(系统,产品ID,版本,Mobo,型号,BIOS等)相同,我们可以使用选项-M
如下:
$ inxi -MMachine: System: LENOVO (portable) product: 20354 v: Lenovo Z50-70Mobo: LENOVO model: Lancer 5A5 v: 31900059WIN Bios: LENOVO v: 9BCN26WW date: 07/31/2014
查找Linux CPU和CPU速度信息
我们可以使用-C
标志显示完整的CPU信息,包括每个CPU时钟速度和CPU最大速度(如果可用),如下所示:
$ inxi -CCPU: Dual core Intel Core i5-4210U (-HT-MCP-) cache: 3072 KB clock speeds: max: 2700 MHz 1: 1942 MHz 2: 1968 MHz 3: 1734 MHz 4: 1710 MHz
在Linux中查找图形卡信息
选项-G
可用于显示图形卡信息(卡类型,显示服务器,分辨率,GLX渲染器和GLX版本),如下所示:
$ inxi -GGraphics: Card-1: Intel Haswell-ULT Integrated Graphics ControllerCard-2: NVIDIA GM108M [GeForce 840M]Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.05hzGLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 11.2.0
在Linux中查找音频/声卡信息
要获得有关系统音频/声卡的信息,我们使用-A
标志:
$ inxi -AAudio: Card-1 Intel 8 Series HD Audio Controller driver: snd_hda_intel Sound: ALSA v: k4.4.0-21-genericCard-2 Intel Haswell-ULT HD Audio Controller driver: snd_hda_intel
查找Linux网卡信息
要显示网卡信息,我们可以使用-N
标志:
$ inxi -NNetwork: Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169Card-2: Realtek RTL8723BE PCIe Wireless Network Adapter driver: rtl8723be
查找Linux硬盘信息
要查看完整的硬盘信息,(size,id,model),我们可以使用-D
:
$ inxi -DDrives: HDD Total Size: 1000.2GB (20.0% used) ID-1: /dev/sda model: ST1000LM024_HN size: 1000.2GB
总结完整的Linux系统信息
显示摘要系统信息;结合以上所有信息,我们需要使用-b
标志如下:
$ inxi -b System: Host: HowToing Kernel: 4.4.0-21-generic x86_64 (64 bit) Desktop: Cinnamon 3.0.7Distro: Linux Mint 18 SarahMachine: System: LENOVO (portable) product: 20354 v: Lenovo Z50-70Mobo: LENOVO model: Lancer 5A5 v: 31900059WIN Bios: LENOVO v: 9BCN26WW date: 07/31/2014CPU: Dual core Intel Core i5-4210U (-HT-MCP-) speed/max: 2018/2700 MHzGraphics: Card-1: Intel Haswell-ULT Integrated Graphics ControllerCard-2: NVIDIA GM108M [GeForce 840M]Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.05hzGLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 11.2.0Network: Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169Card-2: Realtek RTL8723BE PCIe Wireless Network Adapter driver: rtl8723beDrives: HDD Total Size: 1000.2GB (20.0% used)Info: Processes: 233 Uptime: 3:23 Memory: 3137.5/7879.9MB Client: Shell (bash) inxi: 2.2.35
查找Linux硬盘分区详细信息
下一个命令将使我们能够使用-p
标志查看与大小,已用空间,可用空间,文件系统以及每个分区上的文件系统类型相关的硬盘分区的完整列表:
$ inxi -pPartition: ID-1: / size: 324G used: 183G (60%) fs: ext4 dev: /dev/sda10ID-2: swap-1 size: 4.00GB used: 0.00GB (0%) fs: swap dev: /dev/sda9
显示完整的Linux系统信息
为了显示完整的Inxi输出,我们使用-F
标志如下(注意,出于安全原因,某些数据被过滤,例如WAN IP):
$ inxi -F System: Host: HowToing Kernel: 4.4.0-21-generic x86_64 (64 bit) Desktop: Cinnamon 3.0.7Distro: Linux Mint 18 SarahMachine: System: LENOVO (portable) product: 20354 v: Lenovo Z50-70Mobo: LENOVO model: Lancer 5A5 v: 31900059WIN Bios: LENOVO v: 9BCN26WW date: 07/31/2014CPU: Dual core Intel Core i5-4210U (-HT-MCP-) cache: 3072 KB clock speeds: max: 2700 MHz 1: 1716 MHz 2: 1764 MHz 3: 1776 MHz 4: 1800 MHzGraphics: Card-1: Intel Haswell-ULT Integrated Graphics ControllerCard-2: NVIDIA GM108M [GeForce 840M]Display Server: X.Org 1.18.4 drivers: intel (unloaded: fbdev,vesa) Resolution: 1920x1080@60.05hzGLX Renderer: Mesa DRI Intel Haswell Mobile GLX Version: 3.0 Mesa 11.2.0Audio: Card-1 Intel 8 Series HD Audio Controller driver: snd_hda_intel Sound: ALSA v: k4.4.0-21-genericCard-2 Intel Haswell-ULT HD Audio Controller driver: snd_hda_intelNetwork: Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169IF: enp1s0 state: up speed: 100 Mbps duplex: full mac: 28:d2:44:eb:bd:98Card-2: Realtek RTL8723BE PCIe Wireless Network Adapter driver: rtl8723beIF: wlp2s0 state: down mac: 38:b1:db:7c:78:c7Drives: HDD Total Size: 1000.2GB (20.0% used) ID-1: /dev/sda model: ST1000LM024_HN size: 1000.2GBPartition: ID-1: / size: 324G used: 183G (60%) fs: ext4 dev: /dev/sda10ID-2: swap-1 size: 4.00GB used: 0.00GB (0%) fs: swap dev: /dev/sda9RAID: No RAID devices: /proc/mdstat, md_mod kernel module presentSensors: System Temperatures: cpu: 56.0C mobo: N/AFan Speeds (in rpm): cpu: N/AInfo: Processes: 234 Uptime: 3:26 Memory: 3188.9/7879.9MB Client: Shell (bash) inxi: 2.2.35
使用Inxi工具进行Linux系统监控
以下是几个用于监视Linux系统进程,正常运行时间,内存等的选项。
监视Linux进程内存使用情况
获取有关进程总数,正常运行时间和内存使用情况的摘要系统信息:
$ inxi -IInfo: Processes: 232 Uptime: 3:35 Memory: 3256.3/7879.9MB Client: Shell (bash) inxi: 2.2.35
按CPU和内存使用情况监视进程
默认情况下,它可以帮助我们确定消耗CPU或内存的前5个进程 。 与c
(CPU)和/或m
(内存)选项一起使用的-t
选项列出了占用CPU和/或内存的前5个最活跃进程,如下所示:
----------------- Linux CPU Usage ----------------- $ inxi -t c Processes: CPU: % used - top 5 active1: cpu: 53.7% command: plugin-container pid: 30662: cpu: 20.0% command: java pid: 15273: cpu: 19.7% command: firefox pid: 30184: cpu: 4.6% command: Xorg pid: 21145: cpu: 3.0% command: cinnamon pid: 2835
----------------- Linux Memoery Usage ----------------- $ inxi -t mProcesses: Memory: MB / % used - Used/Total: 3212.5/7879.9MB - top 5 active1: mem: 980.51MB (12.4%) command: plugin-container pid: 30662: mem: 508.96MB (6.4%) command: java pid: 15273: mem: 507.89MB (6.4%) command: firefox pid: 30184: mem: 244.05MB (3.0%) command: chrome pid: 74055: mem: 211.46MB (2.6%) command: chrome pid: 6146
----------------- Linux CPU and Memory Usage ----------------- $ inxi -t cmProcesses: CPU: % used - top 5 active1: cpu: 53.7% command: plugin-container pid: 30662: cpu: 20.0% command: java pid: 15273: cpu: 19.7% command: firefox pid: 30184: cpu: 4.6% command: Xorg pid: 21145: cpu: 3.0% command: cinnamon pid: 2835Memory: MB / % used - Used/Total: 3223.6/7879.9MB - top 5 active1: mem: 991.93MB (12.5%) command: plugin-container pid: 30662: mem: 508.96MB (6.4%) command: java pid: 15273: mem: 507.86MB (6.4%) command: firefox pid: 30184: mem: 244.45MB (3.1%) command: chrome pid: 74055: mem: 211.68MB (2.6%) command: chrome pid: 6146
我们可以使用cm
数字(数字可以是1-20)来指定一个不是5的数字,下面的命令将显示我们前10个最活跃的进程占用CPU和内存。
$ inxi -t cm10Processes: CPU: % used - top 10 active1: cpu: 53.4% command: plugin-container pid: 30662: cpu: 19.8% command: java pid: 15273: cpu: 19.5% command: firefox pid: 30184: cpu: 4.5% command: Xorg pid: 21145: cpu: 3.0% command: cinnamon pid: 28356: cpu: 2.8% command: chrome pid: 74057: cpu: 1.1% command: pulseaudio pid: 27338: cpu: 1.0% command: soffice.bin pid: 77999: cpu: 0.9% command: chrome pid: 576310: cpu: 0.5% command: chrome pid: 6179Memory: MB / % used - Used/Total: 3163.1/7879.9MB - top 10 active1: mem: 976.82MB (12.3%) command: plugin-container pid: 30662: mem: 511.70MB (6.4%) command: java pid: 15273: mem: 466.01MB (5.9%) command: firefox pid: 30184: mem: 244.40MB (3.1%) command: chrome pid: 74055: mem: 203.71MB (2.5%) command: chrome pid: 61466: mem: 199.74MB (2.5%) command: chrome pid: 57637: mem: 168.30MB (2.1%) command: cinnamon pid: 28358: mem: 165.51MB (2.1%) command: soffice.bin pid: 77999: mem: 158.91MB (2.0%) command: chrome pid: 617910: mem: 151.83MB (1.9%) command: mysqld pid: 1259
监控Linux网络接口
下面的命令将显示我们的高级网卡信息,包括接口,速度,mac id,状态,IPs等:
$ inxi -NniNetwork: Card-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller driver: r8169IF: enp1s0 state: up speed: 100 Mbps duplex: full mac: 28:d2:44:eb:bd:98Card-2: Realtek RTL8723BE PCIe Wireless Network Adapter driver: rtl8723beIF: wlp2s0 state: down mac: 38:b1:db:7c:78:c7WAN IP: 111.91.115.195 IF: wlp2s0 ip-v4: N/AIF: enp1s0 ip-v4: 192.168.0.103
监控Linux CPU温度和风扇速度
我们可以使用-s选项跟踪硬件安装/配置的传感器输出:
$ inxi -sSensors: System Temperatures: cpu: 53.0C mobo: N/AFan Speeds (in rpm): cpu: N/A
在Linux中查找天气报告
我们还可以使用-w
或-W
<different_location>
来查看当前位置的信息(虽然使用的API不可靠)是否设置不同的位置。
$ inxi -wWeather: Conditions: 93 F (34 C) - smoke Time: February 20, 1:38 PM IST$ inxi -W Mumbai,IndiaWeather: Conditions: 93 F (34 C) - smoke Time: February 20, 1:38 PM IST$ inxi -W Nairobi,KenyaWeather: Conditions: 70 F (21 C) - Mostly Cloudy Time: February 20, 11:08 AM EAT
查找所有Linux副本信息
我们还可以使用-r
标志查看发行版存储库数据:
$ inxi -r Repos: Active apt sources in file: /etc/apt/sources.list.d/dawidd0811-neofetch-xenial.listdeb http://ppa.launchpad.net/dawidd0811/neofetch/ubuntu xenial maindeb-src http://ppa.launchpad.net/dawidd0811/neofetch/ubuntu xenial mainActive apt sources in file: /etc/apt/sources.list.d/dhor-myway-xenial.listdeb http://ppa.launchpad.net/dhor/myway/ubuntu xenial maindeb-src http://ppa.launchpad.net/dhor/myway/ubuntu xenial mainActive apt sources in file: /etc/apt/sources.list.d/official-package-repositories.listdeb http://packages.linuxmint.com sarah main upstream import backportdeb http://archive.ubuntu.com/ubuntu xenial main restricted universe multiversedeb http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiversedeb http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiversedeb http://security.ubuntu.com/ubuntu/ xenial-security main restricted universe multiversedeb http://archive.canonical.com/ubuntu/ xenial partnerActive apt sources in file: /etc/apt/sources.list.d/qbittorrent-team-qbittorrent-stable-xenial.listdeb http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu xenial maindeb-src http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu xenial mainActive apt sources in file: /etc/apt/sources.list.d/slgobinath-safeeyes-xenial.listdeb http://ppa.launchpad.net/slgobinath/safeeyes/ubuntu xenial maindeb-src http://ppa.launchpad.net/slgobinath/safeeyes/ubuntu xenial mainActive apt sources in file: /etc/apt/sources.list.d/snwh-pulp-xenial.listdeb http://ppa.launchpad.net/snwh/pulp/ubuntu xenial maindeb-src http://ppa.launchpad.net/snwh/pulp/ubuntu xenial mainActive apt sources in file: /etc/apt/sources.list.d/twodopeshaggy-jarun-xenial.listdeb http://ppa.launchpad.net/twodopeshaggy/jarun/ubuntu xenial maindeb-src http://ppa.launchpad.net/twodopeshaggy/jarun/ubuntu xenial mainActive apt sources in file: /etc/apt/sources.list.d/ubuntu-mozilla-security-ppa-xenial.listdeb http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu xenial maindeb-src http://ppa.launchpad.net/ubuntu-mozilla-security/ppa/ubuntu xenial main
要查看其当前安装的版本,快速帮助,并打开手册页完整的选项列表和详细的使用信息等等,键入:
$ inxi -v #show version$ inxi -h #quick help$ man inxi #open man page
有关更多信息,请访问官方GitHub存储库: https://github.com/smxi/inxi目前为止就这样了!在本文中,我们回顾了Inxi,一个功能齐全和卓越的命令行工具,用于收集机器硬件和系统信息。这是用于Linux的最好的基于CLI的硬件/系统信息收集工具之一,我曾经使用过。要分享您的想法,请使用下面的评论表。最后,如果你知道其他一些有用的工具,如Inxi在那里,你可以通知我们,我们将很高兴审查它们。