Oct 26, 2023 5 min read

What is hwinfo Linux Command

Use hwinfo Linux Command with our step-by-step tutorial. To find any hardware information, use the hwinfo "hardware information" command.

hwinfo Linux Command
Table of Contents

Introduction

To find any hardware information, use the hwinfo "hardware information" command. We may easily obtain hardware information for the entire system or for any individual hardware item by using this tool. Information like CPU, USB controllers, discs, etc. are provided. We may also use this command to save the specific hardware details in a text file that can be shared.

In this tutorial, you will understand hwinfo Linux command. We will also address a few FAQs on hwinfo Linux command.

What is the hwinfo Command on Linux?

A free and open-source tool called "hwinfo" can be used to view any device's hardware details. The Linux operating system is already installed with this tool. However, if it isn't already installed on your machine, you can use the subsequent commands to do so:

For Debian/Ubuntu-based distributions:

sudo apt install hwinfo

For CentOS/RHEL:

sudo yum install hwinfo

For Fedora Linux:

sudo dnf install hwinfo

For Arch and Manjaro Linux:

sudo pacman -s hwinfo

Let's examine how the "hwinfo" command functions.

How Does hwinfo Command Work?

The "hwinfo" command can be used to obtain general hardware information such as CPU, Network, and Discs, or it can be used to obtain more particular hardware information. A log overview of the data can also be created using it.  The options that the "hwinfo" commands provide are listed below.

HardwarePurpose
CPUTo obtain the CPU information
DisksTo obtain the information about disks
KeyboardTo obtain the keyboard information
MouseTo obtain the mouse information
SoundTo obtain the sound card information
BiosTo obtain the bios information
ChipcardTo obtain the chipcard information
BluetoothTo obtain the Bluetooth information
NetworkTo obtain the network information
Disks PartitionTo obtain information about disks partitions
WLANTo obtain the wifi information

How to Use hwinfo Command in Linux?

The examples below explain the different ways the Linux command "hwinfo" can be used.

Example 1: To Get Whole Hardware information

The "hwinfo" command that follows has retrieved all of my system's hardware data. The two commands are both available to users. The same output will be shown for both commands:

sudo hwinfo
sudo hwinfo --all

The screenshots above display all the hardware's information.

Example 2: To Retrieve the CPU Information

You can also acquire information about a specific hardware component using the "hwinfo" command. For instance, the following command will allow you to access the CPU's information:

sudo hwinfo --cpu

The CPU information is presented as indicated in the above image by running the command mentioned above.

Example 3: To Get the Disks Information

Similarly, you may use the following command at the terminal to acquire information about the discs:

sudo hwinfo --disks

Information regarding the discs is depicted in the above image.

Example 4: To Retrieve the Network Information

The following network information can be acquired by using the "hwinfo" command:

sudo hwinfo --network

The above picture shows the network information:

Example 5: To Get the Partition Information

You may see details about the disc partitions by using the "hwinfo" command. Run the following command:

sudo hwinfo --partition

The image above shows information about disc partitions.

Example 6: To Obtain the Short Hardware Information

The "hwinfo" command can be used to retrieve hardware log data and display the overview:

sudo hwinfo --short

The hardware overview log data is displayed in the images above.

Example 7: To Get the BIOS Information

The following is how the "hwinfo" command can be used to acquire BIOS information:

sudo hwinfo --bios

The information from the BIOS has been displayed by running the above command, as seen in the image above.

Example 8: To Obtain the Sound Card Information

The following is how the information about the sound card is collected using the "hwinfo" command:

sudo hwinfo --sound

The information about the sound card is shown in the accompanying image after executing the aforementioned command.

Pro Tip: Save the Hardware Data in the File

Users also have the choice to save any hardware data in a text file that can be shared with others by using the "hwinfo" command. This command is implemented as follows:

hwinfo --all --log hardwareinfo.txt

As seen in the figure above, all the data will be exported as a file. You can also use this command to get the specific hardware information in a file:

For instance, the following commands will, respectively, save network and keyboard information:

hwinfo --network --log networkinfo.txt 
hwinfo --keyboard --log Keyboardinfo.txt

Furthermore, by executing the aforementioned command with "sudo" (as a root user), the output file can be restricted to read-only permissions:

sudo hwinfo --all --log hardwareinformation.txt

The file will be produced as seen in the image below after the password is entered:

You can obtain additional information about it, as well as how to use it, by issuing the command shown below:

hwinfo --help

FAQs on hwinfo command in Linux

How can I display a summary of system hardware using hwinfo?

To display a summary of the system hardware, you can run hwinfo --short or hwinfo --short-summary command. This provides a concise overview of the detected hardware components.

Can I list all the installed USB devices using hwinfo? 

Yes, you can list all the installed USB devices by running hwinfo --usb. This command will provide detailed information about the connected USB devices such as vendor, model, driver, and more.

How do I gather information about the graphics card using hwinfo? 

To gather information about the graphics card, you can run hwinfo --gfxcard. This command will display detailed information about the installed graphics card, including the vendor, model, driver, and available resolutions.

Are there any options to filter specific hardware information with hwinfo? 

Yes, hwinfo provides various options to filter specific hardware information. You can use options like --cpu, --network, --sound, or --storage followed by a specific category to retrieve detailed information about that specific hardware component.

Is there a way to save the hwinfo output to a file? 

Yes, you can save the hwinfo output to a file by using the redirection operator >. For example, hwinfo --short > hardware_info.txt will save the hardware information to a file named hardware_info.txt.

Can I view the raw detailed hardware information with hwinfo? 

Yes, you can view the raw detailed hardware information by running hwinfo --all. This command provides an extensive list of information about all the hardware components in the system.

Can hwinfo provide real-time monitoring of hardware sensors? 

No, hwinfo is primarily used for retrieving hardware information rather than real-time monitoring of hardware sensors. For monitoring purposes, you may consider tools like lm-sensors or specialized monitoring software.

Conclusion

The "hwinfo" command on Linux is used to obtain both whole and specific hardware information. Additionally, it can be used to access any hardware data stored in a file. The "hwinfo" command has been used in many different ways in this tutorial, each with an example to illustrate it. In addition, a method for gathering hardware data in a text file has also been illustrated.

Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to DevOps Tutorials - VegaStack.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.