Knowledge of your system's hardware specifications is important because it determines whether your computer supports certain software programs and video games. If you would like to upgrade your PC, it's crucial to know what kind of hardware you currently have so that you can determine which parts to upgrade depending on your needs.

This guide will show you some of the most important commands for viewing computer hardware specifications on your Linux system.

1. CPU Information

The Central Processing Unit (CPU) is one of the most important hardware components on your computer. Its primary function is to process logical and mathematical instructions.

The lscpu command gives you a detailed overview of your computer's processor information and its various units. Some of the important information displayed by the lscpu command includes the CPU vendor information, processor architecture, virtualization capabilities of the CPU, and the number of cores your processor has.

Run the following command to list CPU information on your PC:

        lscpu
    
output of lscpu command on linux

The lscpu command gathers information from the /proc/cpuinfo file and displays it in an easy-to-read format.

Learn More: How To Check CPU Temperature on Linux

2. Random Access Memory (RAM)

The Random Access Memory or the primary memory is responsible for storing variable information of programs running on your PC. The RAM is a volatile type of storage unit, meaning the data it holds gets cleared when you shut down or restart the system.

Use the free command to view the amount of memory available on your system and the amount currently in use.

        free -m
    

The free command extracts information from the /proc/meminfo file.

In addition to the memory in use, the output will also show you information related to swap space on your system. Swap space in Linux acts as an extension to your RAM.

Apart from knowing the amount of memory, you might also want to know how many memory slots you have without opening the hood, which is important if you want to install extra RAM or simply upgrade your memory.

Use the dmidecode command to know the number of memory slots on your system and how much RAM each slot currently holds. The dmidecode command reads hardware information from DMI tables.

        sudo dmidecode -t memory | grep -i size
    

The output below shows that this computer has two memory slots and each slot has a memory chip of about 4GB.

output of dmidecode command showing memory slots

You can use the dmidecode command to view other system information such as BIOS, processor, serial numbers, etc. Look at the dmidecode man pages for more command options.

To find information about the maximum amount of RAM that your PC can accommodate:

        dmidecode -t memory | grep -i max
    

Related: How Much RAM Do You Really Need?

3. Hard Disk and Peripheral Devices

Unlike the Random Access Memory, which stores information temporarily, your hard disk persists stored information. The data stored on your hard disk remains available even if your computer powers off or reboots.

Use the df command to view the current disk usage, including the number of partitions and free disk space available. The -h option presents the data in a more human-readable format.

        df -h
    

The command output shows the filesystem in use, the size of the partition, the amount of storage used, and the location of the mounted partition.

Output of df command in linux

Use the fdisk command to get more detailed information related to the number of sectors, their size, the filesystem type, and partition table entries.

        sudo fdisk -l
    

To get brief information related to your entire hard disk device, use the lshw command as follows:

        lshw -short -C disk
    

Viewing Attached Devices Information

The lsusb command views information related to disk devices currently attached to your system. These devices include USB sticks, external disk readers, etc.

        lsusb
    

This command shows the USB controllers and details about devices connected to them. By default, it will display a brief output. Use the -v flag (stands for Verbose) to print detailed information about each USB port.

In addition to USB devices, your computer has other peripheral devices connected. Use the lspci command to view PCI buses and details about devices connected to them.

        lspci
    

Some of the common devices in this category include VGA adapters, graphics cards, network adapters, USB ports, SATA controllers, etc.

Dmesg is another important command that you can use to view hardware devices attached to your Linux PC during bootup.

The dmesg command is not only important for viewing attached hardware devices but is also a great command to look for hardware errors because it stores information about devices as your system boots.

4. Network Card

A network card is a hardware device that allows your computer to connect to other devices on a network. To view information related to your PC's network card, issue the command below:

        sudo lshw -C network
    

The output shows that this particular PC has both a wireless interface and an ethernet wire connection point. In addition, other network connectivity details are listed.

output of network info on linux

5. Hardware Overview

Sometimes you might want to get a comprehensive overview of your entire system's hardware. To do so, use the lshw command.

        lshw
    

The lshw command extracts and outputs detailed information on the hardware configuration of your PC. The command lists information about CPU, graphics, audio, networking, drives, partitions, sensors, bus speed, etc.

The lshw command has many other options to limit the output or only target specific hardware devices. Use the man pages to learn more about its usage and options.

        man lshw
    

Know Your System’s Hardware Specifications

This guide has shown you how to check for important hardware specs on Linux. Knowledge of your PC hardware is important whether you plan to sell or upgrade the system or are seeking IT support.

The best way to know if you need a system upgrade is by testing it yourself. Knowing what component to upgrade in a particular situation will definitely help you in getting the most out of your computer.