在Linux中使用Inxi获取系统和硬件信息的教程
程序员文章站
2022-11-28 13:10:15
这篇文章主要介绍了在Linux中使用Inxi获取系统和硬件信息的教程,Inxi能够读取包括系统中的进程和内存占用情况等内容,需要的朋友可以参考下... 15-05-27...
inxi是一个可以获取完整的系统和硬件详情信息的命令行工具,内容包括:
- 硬件
cpu
磁盘驱动器
xorg
桌面环境
内核
gcc版本
进程
内存占用
和其他有用的信息
安装方法
inxi在多数现代gnu/linux操作系统的默认软件仓库中。所以我们可以简单地运行下列命令安装。
在基于debian的发行版:
复制代码
代码如下: sudo apt-get install inxi
在fedora:
复制代码
代码如下: sudo yum install inxi
在基于rhel的发行版:
安装epel软件仓库:
复制代码
代码如下: sudo yum install epel-release
然后使用如下命令安装inxi:
复制代码
代码如下: sudo yum install inxi
使用方法
在终端运行如下命令可以获取系统的概况信息。
复制代码
代码如下: inxi
示例输出:
复制代码
代码如下: cpu~dual core intel core i3-2350m cpu (-ht-mcp-) clocked at min:800.000mhz max:1200.000mhz kernel~3.13.0-45-generic x86_64 up~6:41 mem~1537.7/3861.3mb hdd~500.1gb(52.5% used) procs~183 client~shell inxi~1.9.17
当然,我们可以获取一个特定硬件的详情信息。比如获取声音/音频硬件详情信息,可以运行如下命令:
复制代码
代码如下: inxi -a
示例输出:
复制代码
代码如下: audio: card: intel 6 series/c200 series family high definition audio controller driver: snd_hda_intel
sound: advanced linux sound architecture ver: k3.13.0-45-generic
sound: advanced linux sound architecture ver: k3.13.0-45-generic
很酷是吧?
同样的,你可以获取显卡的详情信息。
复制代码
代码如下: inxi -g
示例输出:
复制代码
代码如下: graphics: card: intel 2nd generation core processor family integrated graphics controller
x.org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) resolution: 1366x768@60.0hz
glx renderer: mesa dri intel sandybridge mobile glx version: 3.0 mesa 10.3.0
x.org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) resolution: 1366x768@60.0hz
glx renderer: mesa dri intel sandybridge mobile glx version: 3.0 mesa 10.3.0
硬盘信息呢?也是可以的。运行如下命令来获取完整的硬盘信息。
复制代码
代码如下: inxi -d
示例输出:
复制代码
代码如下: drives: hdd total size: 500.1gb (52.5% used) 1: id: /dev/sda model: st9601325bd size: 500.1gb
显示bios和主板详情信息:
复制代码
代码如下: inxi -m
示例输出:
复制代码
代码如下: machine: system: dell (portable) product: inspiron n5050
mobo: dell model: 01hxxj version: a05 bios: dell version: a05 date: 08/03/2012
mobo: dell model: 01hxxj version: a05 bios: dell version: a05 date: 08/03/2012
不仅是硬性详情信息,它也可以显示我们系统中的可用软件仓库列表。
复制代码
代码如下: inxi -r
示例输出:
复制代码
代码如下: repos: active apt sources in file: /etc/apt/sources.list
deb http://ubuntu.excellmedia.net/archive/ trusty main restricted
deb-src http://ubuntu.excellmedia.net/archive/ trusty main restricted
deb http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted
deb-src http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted
deb http://ubuntu.excellmedia.net/archive/ trusty universe
.
.
active apt sources in file: /etc/apt/sources.list.d/intellinuxgraphics.list
deb https://download.01.org/gfx/ubuntu/14.04/main trusty main #intel graphics drivers
active apt sources in file: /etc/apt/sources.list.d/linrunner-tlp-trusty.list
active apt sources in file: /etc/apt/sources.list.d/wseverin-ppa-trusty.list
deb http://ppa.launchpad.net/wseverin/ppa/ubuntu trusty main
deb http://ubuntu.excellmedia.net/archive/ trusty main restricted
deb-src http://ubuntu.excellmedia.net/archive/ trusty main restricted
deb http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted
deb-src http://ubuntu.excellmedia.net/archive/ trusty-updates main restricted
deb http://ubuntu.excellmedia.net/archive/ trusty universe
.
.
active apt sources in file: /etc/apt/sources.list.d/intellinuxgraphics.list
deb https://download.01.org/gfx/ubuntu/14.04/main trusty main #intel graphics drivers
active apt sources in file: /etc/apt/sources.list.d/linrunner-tlp-trusty.list
active apt sources in file: /etc/apt/sources.list.d/wseverin-ppa-trusty.list
deb http://ppa.launchpad.net/wseverin/ppa/ubuntu trusty main
inxi还可以显示你所在位置的天气信息。感到意外吗?是的,它可以。
复制代码
代码如下: inxi -w erode,tamilnadu
这里erode是地区,tamilnadu是印度的一个邦。
示例输出:
复制代码
代码如下: weather: conditions: 79 f (26 c) - clear time: february 4, 6:00 pm ist
查看完整的硬件详情信息
厌倦了逐一获取每种硬件的信息?你可以使用如下命令将所有信息一次列出:
复制代码
代码如下: inxi -f
示例输出:
复制代码
代码如下: system: host: sk kernel: 3.13.0-45-generic x86_64 (64 bit) desktop: lxde (openbox 3.5.2) distro: ubuntu 14.04 trusty
machine: system: dell (portable) product: inspiron n5050
mobo: dell model: 01hxxj version: a05 bios: dell version: a05 date: 08/03/2012
cpu: dual core intel core i3-2350m cpu (-ht-mcp-) cache: 3072 kb flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx)
clock speeds: 1: 800.00 mhz 2: 1000.00 mhz 3: 800.00 mhz 4: 800.00 mhz
graphics: card: intel 2nd generation core processor family integrated graphics controller
x.org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) resolution: 1366x768@60.0hz
glx renderer: mesa dri intel sandybridge mobile glx version: 3.0 mesa 10.3.0
audio: card: intel 6 series/c200 series family high definition audio controller driver: snd_hda_intel
sound: advanced linux sound architecture ver: k3.13.0-45-generic
network: card-1: qualcomm atheros ar9285 wireless network adapter (pci-express) driver: ath9k
if: wlan0 state: up mac:
card-2: realtek rtl8101e/rtl8102e pci express fast ethernet controller driver: r8169
if: eth0 state: down mac:
drives: hdd total size: 500.1gb (52.5% used) 1: id: /dev/sda model: st9500325as size: 500.1gb
partition: id: / size: 455g used: 245g (57%) fs: ext4 id: /boot size: 236m used: 159m (72%) fs: ext2
id: swap-1 size: 4.19gb used: 0.00gb (0%) fs: swap
raid: no raid devices detected - /proc/mdstat and md_mod kernel raid module present
sensors: system temperatures: cpu: 64.5c mobo: n/a
fan speeds (in rpm): cpu: n/a
info: processes: 186 uptime: 6:52 memory: 1547.2/3861.3mb client: shell (bash) inxi: 1.9.17
machine: system: dell (portable) product: inspiron n5050
mobo: dell model: 01hxxj version: a05 bios: dell version: a05 date: 08/03/2012
cpu: dual core intel core i3-2350m cpu (-ht-mcp-) cache: 3072 kb flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx)
clock speeds: 1: 800.00 mhz 2: 1000.00 mhz 3: 800.00 mhz 4: 800.00 mhz
graphics: card: intel 2nd generation core processor family integrated graphics controller
x.org: 1.15.1 drivers: intel (unloaded: fbdev,vesa) resolution: 1366x768@60.0hz
glx renderer: mesa dri intel sandybridge mobile glx version: 3.0 mesa 10.3.0
audio: card: intel 6 series/c200 series family high definition audio controller driver: snd_hda_intel
sound: advanced linux sound architecture ver: k3.13.0-45-generic
network: card-1: qualcomm atheros ar9285 wireless network adapter (pci-express) driver: ath9k
if: wlan0 state: up mac:
card-2: realtek rtl8101e/rtl8102e pci express fast ethernet controller driver: r8169
if: eth0 state: down mac:
drives: hdd total size: 500.1gb (52.5% used) 1: id: /dev/sda model: st9500325as size: 500.1gb
partition: id: / size: 455g used: 245g (57%) fs: ext4 id: /boot size: 236m used: 159m (72%) fs: ext2
id: swap-1 size: 4.19gb used: 0.00gb (0%) fs: swap
raid: no raid devices detected - /proc/mdstat and md_mod kernel raid module present
sensors: system temperatures: cpu: 64.5c mobo: n/a
fan speeds (in rpm): cpu: n/a
info: processes: 186 uptime: 6:52 memory: 1547.2/3861.3mb client: shell (bash) inxi: 1.9.17
就像上面你看到的那样,inxi显示出了完整的硬件详情信息。
更多的细节可以参考man手册。
复制代码
代码如下: man inxi