How to Check Hardware Information on Linux Using Command Line

Spread the love

There are many commands available to check hardware information of your Linux system. Some commands report only specific hardware components like CPU or memory while the rest cover multiple hardware units.

This tutorial takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware devices.

lscpu

The lscpu command gives you information about the CPU and processing units. It does not have any other options or functionality.

lscpu

You will see the following output by running the above command.

lspci

The lspci is another command line tool that lists all the PCI buses and details about the devices connected to them like VGA adapter, graphics card, network adapter, usb ports, SATA controller, etc.

lspci

You will see an output similar to the following image.

You can also filter out specific device information by running the following command:

lspci -v | grep "VGA" -A 12

You will see graphics card information similar to the following.

lshw

The lshw is a general purpose utility that reports detailed and brief information about multiple hardware units like CPU, memory, usb controller, disk, etc. Lshw extracts the information from different “/proc” files.

lshw -short

You will see the following information by running the above command.

lsscsi

You can list all scsi/sata devices like hard drives and optical drives by running the following command:

lsscsi

The output wI’ll look something like this image.

lsusb

This command shows you the USB controllers and details about devices connected to them. By default, the lsusb command prints brief information. You can also use the verbose option -v to print detailed information about each usb port.

lsusb

You will see the following output.

Inxi

Inxi is a bash script that fetches hardware information from multiple sources and commands on the system and gives you goodlooking reports that non-technical users can read easily.

By default, inxi is not installed in Ubuntu. You can install it by running the following command:

sudo apt-get install inxi

After installing inxi, you can get hardware information by running the following command:

inxi -Fx

You will see an output similar to the image below.

df

This command gives you brief information about various partitions, their mount points and the used and available space on each.
You can run the df command with the -H parameter.

df -H

You will see the following output.

Free

You can check the amount of used, free and total amount of RAM on your system with the free command.

free -m

You will see the following output.

Dmidecode

The dmidecode command is different from all other commands. It extracts hardware information by reading data from the DMI tables.

To display information about the processor, run:

sudo dmidecode -t processor

To display information about the memory, run:

sudo dmidecode -t memory

To display information about the bios, run:

sudo dmidecode -t bios

Hdparm

The hdparm command gives you information about sata devices like hard disks.

sudo hdparm

You will see the following output.

Conclusion

Each of the commands has a different method of extracting hardware information. You can try more than one of them while looking for specific hardware details. All of the above tools are available in most Linux distros, and can be easily installed from the default repository.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.
By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time. Subscribe


Hitesh Jethva

Over 5 years of experience as IT system administrator for IT company in India. My skills include a deep knowledge of Rehat/Centos, Ubuntu nginx and Apache, Mysql, Subversion, Linux, Ubuntu, web hosting, web server, squied proxy, NFS, FTP, DNS, Samba, ldap, Openvpn, Haproxy, Amazon web services, WHMCS, Openstack Cloud, Postfix Mail Server, Security etc.

Comments (3)