Hardware Information
This section provides essential command-line tools for retrieving detailed hardware information on your system. Understanding your hardware is crucial for troubleshooting, performance optimization, and system management.
System Hardware Details
The lshw command is a powerful utility that provides a
comprehensive overview of your system's hardware configuration. It
lists details about the CPU, memory, storage devices, network
interfaces, and more.
# To display all hardware details:
sudo lshw
Kernel Modules Management
Kernel modules are pieces of code that can be loaded and unloaded into the kernel on demand. The following commands help you manage and inspect them.
# To list currently loaded kernel modules:
lsmod
# To list all available modules:
find /lib/modules/$(uname -r) -type f -iname "*.ko"
# To load a module:
modprobe <module>
# To remove a module:
modprobe -r <module>
PCI Devices Information
The lspci command displays information about PCI buses
and devices connected to them. This is useful for identifying
specific hardware components like graphics cards, network cards, and
sound cards.
# To list devices connected via pci bus:
lspci
# To debug output for pci devices (hex):
lspci -vvxxx
CPU and Memory Statistics
Accessing the /proc filesystem provides direct insights
into your CPU and memory hardware statistics.
# To display cpu hardware stats:
cat /proc/cpuinfo
# To display memory hardware stats:
cat /proc/meminfo
Kernel Ring Buffer and Messages
The dmesg command is used to display the kernel ring
buffer messages, which are essential for diagnosing boot-time issues
and hardware problems.
# To output the kernel ring buffer:
dmesg
# Ouput kernel messages
dmesg --kernel