Linux lshw Command

25

The Linux Operating System’s beauty is that it allows users to do anything using a command-line tool. You can download applications, fetch information, or even whatever you want to intend can be done using the terminal.

To extract hardware information of the system, the Linux system introduced the command-line utility “lshw.”

The “lshw” command is a small tool to display a complete picture of hardware configuration. While using this command in a terminal, you will get a print of CPU version, memory configuration, cache information, bus speed, and other PowerPC machines running on the backend.

It is a simple command-line tool, but to display complete information, you must be a super-user; otherwise, it will print partial information.

lshw Command Syntax:

Syntax of lshw command is:

lshw Command:

Simply run the “lshw” command to get the complete configuration picture in the terminal with root privileges.

Lshw Format:

lshw command formats can be:

“-short”:

The “short” command-line option is used to display hardware paths in a compact format.

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage7 final.png

“-html”:

To print hardware information in html format, use the “-html” command-line in the terminal.

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage6 final.png

“-xml”:

To print hardware configuration details in xml format, type “-xml” in the terminal.

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage9 final.png

lshw Command Options:

lshw command tool supports multiple options. Every function has its unique functionality.

Enable:

It is used when you want to enable different parameters of the system. For example, I want to allow the “speed” parameter; the command would be:

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage8 final.png

Disable:

To disable any parameter’s functionality, use the “-disable” option with the parameter name.

For example, I enabled “speed” in the above section, So, to disable it:

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage2 final.png

Quiet:

The “quite” option is used to hide display status.

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage1 final.png

Sanitize:

The “sanitize” option is used when users don’t want to display sensitive information.

When we use the “sanitize” option with the “lshw” command, it will print hardware information without any sensitive data.

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage4 finl.png

Help:

To get any help related to the “lshw” command, type “–help” in the terminal, and it will display format options, available command options, and other helping material as well.

D:Wardamarch17Linux lshw Command TutorialLinux lshw Command Tutorialimagesimage3 final.png

Conclusion:

The “lshw” is a command-line tool to extract hardware configuration. We don’t need to install a specific tool or application for this purpose; Linux introduced a small built-in utility to configure hardware data like memory information, cache data, busses, ports, CPU configuration, etc. This guide has seen multiple formats that can display data and “lshw” options to perform different functions.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More