Linux Commands

How to Use Inxi Command in Linux

This article will cover a guide on using the “inxi” command line utility in Linux. It is a free and open source system information tool that can be used to identify and show information about various hardware components present in your Linux PC. Inxi works on all major Linux distributions and it can be especially helpful in resolving hardware issues and optimizing performance of applications that target specific sets of hardware requirements.

Main Features of Inxi

Some of the most important and useful feature of inxi are:

  • Ability to share system information in IRC chat rooms.
  • Ability to produce selective system information for specific categories only. For instance, you can only show information about audio hardware, hard drive units, and so on.
  • Ability to produce colored output in terminal for better readability.
  • Ability to produce detailed information or summarised information.
  • Supports showing information about distribution specific package repositories.
  • Supports showing information about RAID drives.
  • It can show hardware temperature, fan speed and other such information by probing various sensors present in your Linux device.
  • You can control verbosity of the produced output using a command line switch.
  • Ability to show real time weather information as stdout.
  • Ability to hide sensitive and private information using a command line option. For instance, you can replace IP information by using the “–filter” command line switch to hide the real IP address.
  • Supports producing highly detailed system information and detailed kernel information especially useful for sysadmins.
  • It can produce and save output in different file formats like JSON and XML.
  • Ability to show information about connected USB drives.

Installing Inxi in Linux

To install inxi in Ubuntu, use the command specified below:

$ sudo apt install inxi

Inxi is available in the repository of all major Linux distributions, so you can install it from the package manager. Further installation instructions are available on its official website.

Fetching System Information using Inxi

You can produce minimal system information using inxi by running the following command:

$ inxi

Depending on the hardware and software components available in your Linux system, it should produce some output similar to this:

Inxi produces colored output by default. You can change the output color scheme by supplying a number between 0 and 42 to the “-c” switch. For instance, color scheme # 4 produces output in following color theme:

You may have noticed that the inxi command’s default implementation produces only a basic set of hardware information. To produce detailed information, you will have to use the “–full” command line switch.

$ inxi --full

Depending on the hardware configuration of your Linux system, this command should produce category separated output similar to this:

The “–full” switch shows a lot of hardware information. However, it still omits some advanced information suitable for sysadmins and some output classified under verbose category. You can know more about these advanced options by checking out “–verbose” and “–admin” switches available in inxi man page.

Inxi may not be able to probe certain hardware components in your Linux system unless you run it with root access. When you run inxi command without root access, certain fields may be tagged with “<superuser required>” message.

In such a case, run inxi command with sudo, as shown in the command below:

$ sudo inxi --full

You can produce information about some specific categories only using inxi. To do so, run a command in the following format:

$ inxi -C -G

The above command uses “-C” and “-G” switches for producing information about CPU and GPU units respectively. You can know more about all category specific switches from its man page. After running the above command, you should get some output similar to this:

You can combine multiple command line switches into one. The command below produces the same output as above:

$ inxi -CG

To censor sensitive information, use “–filter” switch, as shown in the command below:

$ inxi -M --filter

Sensitive information like serial numbers and IP addresses will be tagged with “<filter>” string and original data will never be shown in the output, as shown in the screenshot below:

This covers the most common use cases for the inxi command. To know more about its advanced options, use these commands in a terminal:

$ man inxi
$ inxi --help

Saving Hardware Information to a File

To save produced output to a text file, run a command in the following format:

$ inxi --full > info.txt

You can replace “info.txt” with any other file name. Output produced by inxi will be saved to this text file. To export inxi data to json and xml files, run the following two commands:

$ inxi -full --output json --output-file "$HOME/info.json"
$ inxi -full --output xml --output-file "$HOME/info.xml"

You can replace the full path for the output file with your desired value. Note that in some Linux distributions, inxi may throw an error about missing libraries when generating output in JSON or XML format. To know more about what libraries are missing, run the following command:

$ inxi --recommends

Just go through the output and install required packages for missing libraries from the package manager of your Linux distribution.

Conclusion

Inxi is a useful command line tool that can be used to create neatly categorized and systematic hardware information about your Linux PC. You can share this information in various file formats, mostly suitable for debugging software and hardware related issues.

About the author

Nitesh Kumar

I am a freelancer software developer and content writer who loves Linux, open source software and the free software community.