Introduction to the LSHW Command in Linux - Usage & Examples
What is the lshw Command in Linux?
The lshw command is one of the most commonly used commands for finding detailed information about the hardware of a system in Linux. It stands for "list hardware" and can be used to view the detailed configuration of a system's hardware components, including their bus and device numbers, model numbers, and versions.
How to Use the lshw Command in Linux
The lshw command is typically used from the command line by typing in the following:
lshw
This command will produce an extensive report of the system's hardware based on its own internal database. By default, this report includes information like the type of processor, type of RAM, storage device, and other details relating to the system's hardware.
Examples of the lshw Command in Linux
The lshw command is versatile enough to produce a variety of outputs. Below are some examples of how the command can be used.
Listing All Detected Hardware
lshw -short
This command will produce a short list of all the hardware components detected on the system.
Limiting Search Scope to Specific Bus Number
lshw -busnum 8
This command will limit the search scope to hardware components with a bus number of 8.
Excluding Network Devices From Listing
lshw -class network -disable
This command will exclude network devices from the listing of detected hardware.
Conclusion
The lshw command is an invaluable tool for gathering detailed information about the hardware of a Linux system. With the right flags, it can be used to produce customized listings of hardware components and even exclude certain types of components from the listing entirely. Keep in mind that the output of this command is subject to change between different versions of the operating system.