Basic Linux Commands to Check Hardware and System Information

Yağmur Şahin
Dec 26, 2020 · 5 min read

Once the Linux kernel initializes, it enumerates all hardware components. There are plenty of commands to check information about the hardware of a Linux system. Some commands report only specific hardware components like CPU or memory while the rest cover multiple hardware units.

Image for post
Image for post
Photo by Florian Krumm on Unsplash

1. Printing Machine Hardware Name (uname –m uname –a)

$ uname –m

$ uname -a

Image for post
Image for post
photo by author

2. lscpu

$ lscpu

Image for post
Image for post
photo by author

lshw –List Hardware

$ sudo lshw $ sudo lshw –short

Generate report in html/xml format

We can also export lshw reports in html, xml and json formats.

$ sudo lshw –html > lshw-output.html

$ sudo lshw –xml >lshw-output.xml

2. hwinfo- Hardware Information

$ hwinfo

$ hwinfo –short

Image for post
Image for post
photo by author

3. lspci- List PCI

$ lspci

Image for post
Image for post
photo by author

4. lsscsi-List sci devices

$ lsscsi

Image for post
Image for post
photo by author

5. lsusb- List usb buses and device details

$ lsusb

6. lsblk- List block devices

$ lsblk

7. df-disk space of file systems

$ df -H

8. fdisk

$ sudo fdisk –l

9. mount

$ mount | column -t

Image for post
Image for post
photo by author

10. Dmidecode

$ sudo dmidecode -t processor # memory/ram information

$ sudo dmidecode -t memory # bios details

$ sudo dmidecode -t bios

11. /proc files

Image for post
Image for post
photo by author

CPU/Memory information

$ cat /proc/cpuinfo

Version

$ cat /proc/version

SCSI/Sata devices

$ cat /proc/scsi/scsi

Partitions

$ cat /proc/partitions

12. hdparm

We may need to try more than one of them, while looking for specific hardware details. They are available across most linux distros, and can be easily installed from the default repositories. On the desktop there are gui tools, for those who do not want to memorise and type commands. Hardinfo, I-nex are some of the popular ones that provide detailed information about multiple different hardware components.

$ hdparm

13. Inxi

$ inxi –Fx

Image for post
Image for post
photo by author

Technology Hits

Important, informing, and engaging stories on technology

Sign up for Technology Hits Highlights

By Technology Hits

Featured stories, tech news, industry trends, useful tips Take a look.

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Yağmur Şahin

Written by

Ankara University Faculty of Law | Gazi University InfoSec Eng. | METU Cyber Security | Data Security/Privacy Counselor

Technology Hits

Important, high-impact, informative, and engaging stories on all aspects of technology.

Yağmur Şahin

Written by

Ankara University Faculty of Law | Gazi University InfoSec Eng. | METU Cyber Security | Data Security/Privacy Counselor

Technology Hits

Important, high-impact, informative, and engaging stories on all aspects of technology.

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store