12 Commands to Check Linux System and Hardware Information: Best Guide

Posted on

12 Commands to Check Linux System and Hardware Information: Best Guide

12 Commands to Check Linux System and Hardware Information: Best Guide

In this guide, you will learn to use 12 Commands to Check Linux System and Hardware Information. As a Linux user, understanding your Linux system information and hardware specifications is crucial for troubleshooting, performance optimization, and general system administration. These Linux commands provide detailed information about your Linux system and its hardware components. Follow the rest of the article from the Orcacore website to get familiar with these 12 Commands to Check Linux System and Hardware Information.

You can easily use Linux commands to check the system information, CPU, Memory, Hardware, etc. Now follow the steps below to see what are these amazing commands and the usage of them. This guide provides a comprehensive overview of these tools, ensuring you have the knowledge to effectively manage your Linux environment and obtain the necessary insights into your system’s configuration. Let’s explore how to use 12 Commands to Check Linux System and Hardware Information!

Step 1 – Check Linux System Information

At this point, you can easily find your system information such as system name, and kernel version by using the following command:

Command Number 1: The uname command

uname -a

The -a option will show you all the system information.

**Example Output**
Linux ubuntu.jammy 5.15.0-46-generic #49-Ubuntu SMP Thu Aug 4 18:03:25 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

From the output, you will see your Linux system name, Network hostname, Kernel release, Kernel version, and hardware name.

Also, you can use other options in the uname command to check your desired information:

Step 2 – Check Linux File System Partitions

If you want to check your file system partitions, you can easily use the following command:

Command Number 2: The fdisk Command

You can use the -l option in the fdisk command to list your file system partitions:

fdisk -l
**Example Output**
Disk /dev/loop0: 61.96 MiB, 64970752 bytes, 126896 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/loop1: 61.89 MiB, 64901120 bytes, 126760 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
...

Step 3- Check Linux Hardware Information

At this point, you can easily display your Hardware information in detail such as motherboard, RAM, or cache configurations, firmware version, bus speed, CPU, and speed by using the command below:

Command Number 3: The lshw command

lshw

This will give a long information about every detailed hardware information. If you want to get a shortlist and take a brief look at your Hardware information, you can use the -short option in the lshw command:

lshw -short

Step 4 – Check Linux Memory, BIOS, and Processor Information

At this point, you can find out your Linux system, memory, BIOS, and processor information by using the command below:

Command number 4: The dmidecode command

dmidecode -t target-info

The -t option is used for the target entry you want to get the information about it.

Also, there are many more commands that you can check your free space and used memory or file system partitions.

Command Number 5: The free Command

This free command with the -m option, will display you the total memory, used memory, and free memory on your Linux system.

free -m

Command Number 6: The df command

To check the file system’s partitions, mount points, and disk spaces, you can easily use the df command with the -H option.

df -H

Step 5 – Check Linux CPU Information

There is a command that you can use to display your CPU information in detail on your Linux system:

Command Number 7: The lscpu command

lscpu
**Example Output**
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  2
  On-line CPU(s) list:   0,1
Vendor ID:               GenuineIntel
...

Step 6 – Check Linux USB Controllers

At this point, you can check your USB devices that are communicating with your computer by using the following command:

Command Number 8: The lsusb command

lsusb

Also, you can use the -v option to get the information in detail:

lsusb -v

Step 7 – Display SATA (Serial Advanced Technology Attached) Disk Information

SATA is an interface that is used to transfer data between storage devices and motherboards. To check the Linux SATA disk information such as serial number and model, you can use the command below:

Command Number 9: The hdparm command

You must specify the device path to the command to check your SATA disk information:

hdparm <device name>

For example:

hdparm /dev/sda

Step 8 – Display Linux SCSI Devices

SCSI which stands for Small Computer System Interface, is a high-level driver that handles a variety of storage hardware. To check your Linux SCSI device information, you can use the following command:

Command Number 10: The lsscsi command

lsscsi

Also, you can use the -s option to show the device sizes.

Note: To use the lsscsi command on your Linux distro, you must install it. It is not installed by default on the server.

To install it on Debian-based distros, you can use:

apt install lsscsi

To install it on Centos and RHEL-based distros, you can use:

yum install lsscsi #centos7,rhel7
dnf install lsscsi #centos8,rhel8,rhel9

Step 9 – List Linux Block Devices

Block Devices can physically attach to the computer and you can access them remotely such as CD-ROM, flash, or hard drives. To list the Linux block devices, you can use the following command:

Command Number 11: The lsblk command

lsblk
**Example Output**
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
loop0    7:0    0    62M  1 loop /snap/core20/1587
loop1    7:1    0  61.9M  1 loop /snap/core20/1405
loop2    7:2    0  79.9M  1 loop /snap/lxd/22923
loop3    7:3    0  44.7M  1 loop /snap/snapd/15534
loop4    7:4    0    47M  1 loop /snap/snapd/16292
...

Step 10 – List Linux PCI devices

PCI which stands for Peripheral Component Interconnect is used to connect different peripherals of the Linux Platform. You can list the PCI devices in Linux by using the command below:

Command Number 12: The lspci command

lspci

Also, you can use the -v option to get the detailed information:

lspci -v

Conclusion

At this point, you have become familiar with the most useful 12 Commands to Check Linux System and Hardware Information. These are the most useable Linux Commands that every Linux user must know that easily check the system information and hardware. These commands offer a wealth of information, enabling you to understand and manage your Linux system effectively. Mastering these tools is essential for any Linux user, from beginners to experienced system administrators. Learning 12 Commands to Check Linux System and Hardware Information are very helpful.

Do you know other Linux commands that are useful for system checks and hardware info? Please comment for us and share your ideas.

Hope you enjoy it. You may also like the following articles:

Best Sites to Run Linux in Browser

4 Ways To Install OpenCV on Debian 12 Bookworm

Clean Up Unnecessary and Junk Files on Ubuntu

Alternative Solutions for Gathering System and Hardware Information

While the commands listed above are powerful and widely used, there are alternative approaches to gathering the same or similar information on a Linux system. These alternatives might offer different levels of detail, formatting options, or even rely on different underlying mechanisms. Here are two such alternative methods:

Alternative 1: Using /proc Filesystem

The /proc filesystem is a virtual filesystem that exposes kernel data structures as files. This allows users to access system information directly without relying on specific commands. Many of the commands discussed above actually read information from the /proc filesystem.

  • Explanation: The /proc filesystem contains numerous files and directories, each representing a different aspect of the system. For example, /proc/cpuinfo contains detailed information about the CPU, /proc/meminfo contains memory statistics, and /proc/partitions lists the disk partitions.

  • Example: To get CPU information similar to what lscpu provides, you can read the contents of /proc/cpuinfo:

    cat /proc/cpuinfo

    This command will output a stream of information about each CPU core, including its model name, clock speed, and supported features. Similarly, to see memory information as free -m presents, use:

    cat /proc/meminfo

    This shows detailed memory statistics in bytes. The output is less formatted than free -m, but contains the same core data.

  • Benefits: Accessing /proc files directly can be faster and more lightweight than running separate commands. It also provides a more granular view of the system’s internal state.

  • Drawbacks: The format of the files in /proc can be less user-friendly than the output of dedicated commands. Parsing the data often requires scripting skills. Also, the available files and their contents might vary slightly between different kernel versions.

Alternative 2: Using GUI Tools (Graphical User Interface)

For users who prefer a graphical interface, many Linux distributions offer GUI tools for displaying system and hardware information. These tools often present the information in a more visually appealing and easier-to-understand format.

  • Explanation: GUI tools typically leverage the same underlying mechanisms as the command-line tools (e.g., reading /proc files, using dmidecode), but they present the data in a graphical window with interactive elements.
  • Example:
    • GNOME System Monitor: Most GNOME-based distributions include the "System Monitor" application. This tool provides tabs for monitoring CPU usage, memory usage, network activity, and processes. It also includes a "Resources" tab that displays basic hardware information.
    • KDE System Monitor (KSysGuard): KDE Plasma environments offer KSysGuard, which is a powerful system monitoring tool. It allows you to track various system parameters and view hardware information in a highly customizable way.
    • HardInfo: HardInfo is a dedicated system profiler and benchmark tool that provides detailed information about your hardware. It’s available for many distributions and provides a clean, easy-to-navigate interface. Installation command varies between distributions; for Debian/Ubuntu use sudo apt install hardinfo.
  • Benefits: GUI tools are generally easier to use for novice users. They often provide a more visually appealing and intuitive way to explore system information.
  • Drawbacks: GUI tools typically consume more system resources than command-line tools. They may also offer less flexibility and customization options. Additionally, relying solely on GUI tools can limit your ability to automate tasks or access system information remotely.

In conclusion, while the 12 commands outlined in the original article provide a solid foundation for gathering Linux system and hardware information, exploring alternative methods like the /proc filesystem and GUI tools can broaden your understanding and offer different perspectives on your system’s configuration.

Leave a Reply

Your email address will not be published. Required fields are marked *