Whether you’re a seasoned sysadmin, a curious tinkerer, or just someone wanting to know more about their Linux machine, examining system hardware is a valuable skill. Knowing how to check your hardware components and their status can help troubleshoot issues, upgrade your system, or simply satisfy your curiosity. In this guide, we’ll explore various methods to inspect and monitor your system’s hardware in a Linux environment.
Using Command-Line Utilities
1. lshw (List Hardware)
- Installation: Most Linux distributions have
lshwpre-installed, but if not, you can usually install it via your package manager (e.g.,sudo apt install lshwfor Debian/Ubuntu). - Usage: Open your terminal and run
sudo lshwto display detailed hardware information. Use-shortfor a more concise summary.
2. lscpu (List CPU Information)
- Installation: This utility is also typically pre-installed. If not, install it with
sudo apt install util-linux(for Debian/Ubuntu). - Usage: Running
lscpuin your terminal will provide detailed information about your CPU, including its architecture, number of cores, and more.
3. lsblk (List Block Devices)
- Installation: You’ll find
lsblkon most Linux systems. If not, install it via your package manager. - Usage: Type
lsblkto see a tree-like structure of your block devices, including hard drives and partitions.
4. free (Display Memory Usage)
- Installation:
freeis typically pre-installed. - Usage: Run
free -mto display memory usage in megabytes orfree -gfor gigabytes. It provides information about total, used, and free memory.
5. df (Display Disk Space Usage)
- Installation:
dfis another command-line tool that’s usually pre-installed. - Usage: Type
df -hto list available disk space on your filesystems in human-readable format.
Graphical Tools
1. GNOME System Monitor
- Installation: If you use the GNOME desktop environment, you likely have the System Monitor pre-installed. If not, you can install it through your package manager.
- Usage: Launch it from your applications menu, and you’ll find tabs for viewing system resources, including CPU, memory, and storage.
2. KDE System Monitor (KSysGuard)
- Installation: KSysGuard comes with the KDE Plasma desktop environment.
- Usage: Access it through your application launcher. It provides detailed system information and real-time monitoring of resource usage.
3. HardInfo
- Installation: You may need to install HardInfo via your package manager (e.g.,
sudo apt install hardinfofor Debian/Ubuntu). - Usage: After installation, open HardInfo, and you’ll find a comprehensive hardware report organised into categories.
Specialised Tools
1. hwinfo
- Installation:
hwinfomay require installation through your package manager (e.g.,sudo apt install hwinfofor Debian/Ubuntu). - Usage: Run
sudo hwinfoto obtain extensive hardware information, including details about peripherals and network devices.
2. inxi
- Installation:
inxiis not always pre-installed but can be installed using your package manager. - Usage: Execute
inxi -Ffor a full hardware report. It’s known for its easy-to-read and informative output.
Checking Specific Hardware Components
1. GPU (Graphics Processing Unit)
- Nvidia: Use the
nvidia-smicommand if you have Nvidia graphics. - AMD: For AMD GPUs,
radeontopprovides insights into GPU utilisation.
2. Hard Drive SMART Data
- Install
smartmontoolsvia your package manager and usesmartctlto check the health and SMART attributes of your hard drives.
3. Temperature and Fan Speed
- Tools like
lm-sensorsandpsensorcan help you monitor temperature sensors and fan speeds. Install them using your package manager.
Conclusion
Being able to check your system’s hardware is a valuable skill for Linux users, whether you’re a novice or an experienced sysadmin. The methods and tools mentioned in this guide should empower you to explore your hardware, diagnose issues, and make informed decisions about upgrades or optimisations. Whether you prefer command-line utilities or graphical tools, Linux offers a diverse range of options for hardware inspection and monitoring.