Show A List of Your Hardware in Ubuntu…

Unlock powerful system information tools in your Linux system with these simple terminal commands

One of the many advantages of using Ubuntu (or any Linux distribution) is the powerful command-line interface that gives you direct access to system information. Whether you’re troubleshooting hardware issues, planning upgrades, or simply curious about what’s inside your computer, Ubuntu provides several built-in commands to help you gather detailed hardware information.

In this guide, I’ll walk you through some essential terminal commands for checking your hardware details, starting with the comprehensive lshw utility. These tools are particularly useful when you need to check hardware compatibility, diagnose system problems, or document your system specifications.

The lshw Command: Your Complete Hardware Overview

The lshw (list hardware) command is one of the most comprehensive tools for displaying detailed hardware information in Ubuntu. To use it effectively, you’ll need superuser privileges:

sudo lshw

This command generates a detailed report of your entire system hardware, including information about your:

  • CPU (model, speed, capabilities)
  • Memory (size, type, speed)
  • Storage devices (HDDs, SSDs, optical drives)
  • Network interfaces (Ethernet, Wi-Fi)
  • Graphics cards
  • USB controllers and devices
  • PCI devices and much more

The output from lshw can be quite lengthy and might scroll by too quickly to read. To make it more manageable, you can pipe the output to the less command by typing sudo lshw | less. This allows you to navigate through the information page by page using the arrow keys.

Formatting lshw Output for Better Readability

The standard output of lshw can be overwhelming with its dense information. Fortunately, the command offers various output formats to make the information more readable:

sudo lshw -short

The -short option provides a more concise, tabular summary of your hardware, which is perfect for getting a quick overview. For a specific hardware class, you can use:

sudo lshw -C memory

This will list only memory-related information, making it easier to find specific details about your RAM. Other useful classes include processor, disk, network, and display.

For advanced users, lshw can output in HTML or XML formats, which can be useful for documentation or further processing. Use sudo lshw -html > hardware.html to create an HTML file of your hardware information that you can open in any web browser.

More Essential Hardware Commands

While lshw is comprehensive, Ubuntu offers several other specialized commands that can provide focused hardware information:

Quick Reference: Hardware Commands

  • free -h – Shows memory usage in human-readable format
  • lscpu – Displays detailed CPU information
  • lsblk – Lists all block devices (storage)
  • lspci – Shows PCI devices
  • lsusb – Lists USB devices
  • df -h – Shows disk space usage
  • dmidecode – Provides DMI (SMBIOS) table contents

For detailed CPU information, lscpu provides a focused view:

lscpu

This command shows your processor architecture, model name, core count, thread count, cache sizes, and more. It’s particularly useful when you need specific CPU details without the comprehensive output of lshw.

For monitoring system resources in real-time, try the htop command (you may need to install it first with sudo apt install htop). This interactive tool provides a colorful, dynamic view of CPU usage, memory consumption, and running processes.

Putting It All Together

Understanding your hardware is essential for system maintenance, troubleshooting, and planning upgrades. Ubuntu’s command-line tools provide powerful ways to access this information quickly and efficiently. Start with sudo lshw for a comprehensive overview, then use more specialized commands as needed for specific hardware components.

While graphical tools exist for hardware inspection, command-line utilities often provide more detailed information and can be easily incorporated into scripts for automated system documentation. They’re also invaluable when troubleshooting systems without a functioning graphical interface.

Join the Conversation

What’s your favorite Ubuntu command for system information? Have you discovered any lesser-known utilities that make hardware inspection easier? Share your tips in the comments below!