There are many commands that can be used to view hardware information on a Linux system. Some commands can only print out specific hardware component information such as CPU and memory, while others may view information on a variety of hardware components.
This tutorial will give you a quick look at the most common commands for viewing information and configuration details for various hardware devices.
Lscpu
The LSCPU command is able to view the CPU and processing unit information. The command does not have any other options or other features.
Lscpu
Running the command will see the following output:
Lspci
LSPCI is another command-line tool that can be used to list all PCI buses, as well as details about the devices connected to the PCI bus, such as VGA adapters, video cards, network adapters, USB ports, SATA controllers, and so on.
Lspci
You can see similar output information.
You can filter out information for a specific device by running the following command:
Lspci-v | grep "VGA"-A 12
Run the above command to see similar information about the video card.
Lshw
LSHW is a versatile tool that lists detailed or summary information about a variety of hardware units, such as CPUs, memory, USB controllers, hard drives, and more. LSHW is able to extract relevant information from various "/proc" files.
Lshw-short
You can see the following information by running the above command.
Lsscsi
You can list information such as scsi/sata devices such as hard drives and optical drives by running the following command:
Lsscsi
will get output similar to the following.
Lsusb
The LSUSB command lists the details of the USB controller and the device connected to the USB controller. By default, the LSUSB command prints only the summary information. You can print detailed information for each USB port by using the-v parameter.
Lsusb
You can see the output below.
Inxi
Inxi is a bash script that gets hardware information from multiple sources and commands in the system and prints a friendly report that non-technical people can read.
By default, Inxi is not installed on Ubuntu. You can install Inxi by running the following command:
sudo apt-get install Inxi
After installing Inxi, you can get hardware-related information by running the following command:
Inxi-fx
Can get a similar output.
Df
The DF command lists profile information, mount points, used, and available space for different partitions.
You can add the-h parameter when you use the DF command.
Df-h
will get the following output.
Free
Use the free command to see the total number of idle and RAM used in the system.
Free-m
You will see the output below.
Dmidecode
The Dmidecode command differs from other commands. The command reads information from the DMI table in the hardware.
To view the processor information, run the following command:
sudo dmidecode-t processor
To view the memory information, run the following command:
sudo dmidecode-t memory
To view the BIOS information, run the following command:
sudo dmidecode-t bios
Hdparm
The hdparm command can be used to display information about a SATA device such as a hard disk.
sudo hdparm
You can see the following output.
Summarize
Each command has a different way to get information about the hardware. When viewing specific hardware information, you can try different ways. All of the above command-line tools are available in most Linux distributions and can be easily obtained from the repository.
Linux System View hardware information command Daquan