Forrest logo
back to the lshw tool

lshw:tldr:1f941

lshw: Save all network interfaces to an HTML file.
$ sudo lshw -class network -html > ${interfaces-html}
try on your machine

This command is used to generate a detailed hardware report of the network devices installed on a Linux system in HTML format. Here is a breakdown of the command:

  • sudo: This is a command used to execute the following command with administrative privileges or as a superuser. It may prompt for a password.

  • lshw: This is a command-line utility that stands for "list hardware" and is used to display detailed information about the hardware components of a system.

  • -class network: This option specifies that we are interested in retrieving information about network devices. It filters the output to only display network-related hardware details.

  • -html: This flag instructs lshw to generate the output in HTML format.

  • > ${interfaces-html}: This part directs the output of the command to a file named interfaces-html. The > symbol is used for output redirection, and ${interfaces-html} is a variable that represents the name of the output file. The file will be created (or overwritten) in the current working directory.

Overall, this command executes the lshw command with escalated privileges, filters the output to only include network-related hardware details, converts the output to HTML, and saves it to a file called interfaces-html.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the lshw tool