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. 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. You will see an output similar to the following image.

You can also filter out specific device information by running the following command: 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. 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: 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. 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: After installing inxi, you can get hardware information by running the following command: 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. 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. 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:

To display information about the memory, run:

To display information about the bios, run:

Hdparm

The hdparm command gives you information about sata devices like hard disks. 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.