Linux Commands

How to use hwinfo Command in Linux

While using Linux Mint you might come across the need to know the details about your hardware devices attached to the system. You can use the command-line programme hwinfo for this task. Using this tool, you can display short or brief details of all the hardware and can save it to a text file.

How to Install hwinfo Command Line Tool in Linux

You can use the below mentioned method to install the hwinfo command line tool on Linux system:

Installation of hwinfo Command Line Tool in Linux Using Apt

For the installation of hwinfo command line tool execute the command given below:

sudo apt install hwinfo

To Uninstall hwinfo command line tool execute the command given below:

sudo apt remove --autoremove hwinfo

Getting help of hwinfo Command Line Tool

To get the help about the hwinfo command execute the command given below:

hwinfo --help

How to Use hwinfo Command Line Tool in Linux

You can use the hwinfo command for the following purposes:

  • Display all information about all hardware units
  • Save hardware info to file
  • Display device-specific information

Display Information about all Hardware Units

To display all information about your system, execute the command given below:

sudo hwinfo

Or you can execute the command given below to display all information:

sudo hwinfo --all

Display Brief Information about all Hardware Units

If you want to display the brief information about all Hardware Units and not the details then execute the command given below:

hwinfo --short

Save the Hardware Information into File

You can save all the information into a file that you displayed by executing the command given below:

hwinfo --all --log hardwareinfo.txt

Or:

hwinfo --all > hardwareinfo.txt

Display Device-specific Information with hwinfo

You can also display the information about a specific drive using the hwinfo command using the below mentioned command formats.

The given below command format is to display all the information about a device:

sudo hwinfo --<device name>

You can use the following command format to display brief information about a device:

sudo hwinfo --short --<device name>

Display CPU Details

To display the information about CPU, execute the command given below:

sudo hwinfo --cpu

To display the short information about CPU execute the command given below:

sudo hwinfo --short --cpu

Display Partition Details

To display the information about partition details, execute the command given below:

sudo hwinfo --partition

To display the short information about partition details, execute the command given below:

sudo hwinfo --short --partition

Display Sound Card Details

You can display the information about sound by executing:

sudo hwinfo --sound

You can display the short information about sound by executing the command given below:

sudo hwinfo --short --sound

Display Memory Details

You can display the information about memory by executing the command given below:

sudo hwinfo --memory

You can display the short information about memory by executing the command given below:

sudo hwinfo --short --memory

Display Network Details

To display the information about network details, execute the command given below:

sudo hwinfo --network

You can display the short information about network by executing the command given below:

sudo hwinfo --short --network

Display Disk Details

To display the information about disk details, execute the command given below:

sudo hwinfo --disk

You can display the short information about disk by executing the command given below:

sudo hwinfo --short --disk

7: Display System Architecture Details

To display the information about Architecture of your system execute:

sudo hwinfo --arch

To display the brief information about Architecture of your system execute the command given below:

sudo hwinfo --short --arch

Display BIOS Details

To display the information about BIOS of your system execute the command given below:

sudo hwinfo --bios

To display the brief information about BiOS of your system execute the command given below:

sudo hwinfo --short --bios

Export Hardware Information of a Device to a File

You can export the device specific information to a file by using the format of the command given below:

hwinfo --<device name> > <file name>.txt

For example, you can export the information of architecture to a file by using the format of the command given below:

hwinfo --arch > hardwareinfo_arch.txt

Conclusion

If you want to get the details of the hardware devices you are using you can just install the hwinfo command line tool using apt package manager. You can learn every detail about the hardware devices after installing this utility and save the information into the text files. To know all the utilities of the hwinfo command line tool follow the guide mentioned above in the article.

About the author

Rafia Amjad

I have a degree in Electronics and love to write. My research and writing emphasize on the most recent innovations in gaming and technology.