- How to Check Hardware Information in Linux
- Commands to Check Hardware Information in Linux
- Iscpu
- Ishw
- Install Ishw
- Using Ishw
- Report full info
- Report brief info
- Hwinfo
- Install Hwinfo
- Using Hwinfo
- Report all info
- Report brief info
- Lspci
- Using grep
- Lsscsi
- Lsusb
- Lnxi
- Isblk
- Df
- Pydf
- Fdisk
- Mount
- Using grep
- Free
- Dmidecode
- CPU info
- Ram info
- Bios info
- /proc files
- CPU and Memory info
- Kernel info
- SCSI devices
- Partitions
- Hdparm
- Conclusion
- FAQ
- Nisal N
- Getting information on a machine’s hardware in Linux
- 6 Answers 6
How to Check Hardware Information in Linux
If you’re a Linux user, you may want to know what hardware your system is running on. This can be useful for troubleshooting or when you’re looking to upgrade your system. Also, for system administrators, it is important to have a good understanding of the hardware components in the system. This blog post teaches you the commands you can use to check your hardware information in Linux.
List of content you will read in this article:
If you’re a Linux user, you may want to know what hardware your system is running on. This can be useful for troubleshooting or when you’re looking to upgrade your system. Also, for system administrators, it is important to have a good understanding of the hardware components in the system. This blog post teaches you the commands you can use to check your hardware information in Linux.
Commands to Check Hardware Information in Linux
Hardware information can be obtained by using different commands in Linux. This section will teach you the common Linux commands for checking hardware info with detailed examples.
Iscpu
This command is used to report information about the CPU of your system. And it doesn’t provide any further functionality or option.
Syntax : $ Iscpu
Ishw
This command reports brief and detailed information about several hardware components such as CPU, Memory, Disk, Network adapter, USB controller, etc. This command will extract the information from different /proc files.
Install Ishw
Using Ubuntu or Debian, you can get it from default repositories.
Syntax : $ sudo apt-get install lshw
If you use Fedora, install it from the default repositories. On CentOS, you can install Ishw from the Epl repository.
Syntax : $ sudo yum install lshw
Using Ishw
You need to run this command with super privileges to detect and report the maximum amount of information. SO run this command as root, or use sudo.
Syntax : $ sudo lshw
Report full info
Running «Ishw» will generate full information and report about all detected hardware.
And it contains a big output with a lot of technical details.
Syntax : $ sudo lshw
Report brief info
With the «-short», you will generate brief information about the hardware devices. And it gives you an idea about the hardware profile of your system.
Syntax : $ sudo lshw -short
Hwinfo
Hwinfo is another useful command to generate detailed and brief information about several different hardware components, even more than Ishw.
Install Hwinfo
It’s available in the repositories of Ubuntu and Debian.
Syntax : $ sudo apt-get install hwinfo
Using Hwinfo
You can mention the hardware component you want to see the information of.
Syntax : $ hwinfo –help
Report all info
Running this command will give you full information about all hardware units.
Syntax : $ hwinfo
Report brief info
With the «-short» command, you will get brief information about the hardware devices but not the details.
Syntax : $ hwinfo –short
Lspci
This command displays information about PCI buses and the devices connected to the PCI subsystem. And includes a graphic card, network adapter, USB ports, etc.
Syntax : $ lspci
Using grep
With grep, you can filter specific devices’ information.
Syntax : $ lspci -v | grep «VGA» -A 12
Lsscsi
This command reports the scsi/sata devices, such as hard and optical drivers.
Syntax : $ lsscsi
Lsusb
This command displays brief information about the USB controllers and connected devices. You can also get detailed information about each USB port using the verbose option «-v».
Syntax : $ lsusb
Syntax : $ lsusb -v
Lnxi
Lnxi tool is a full-featured CLI utility that generates easy-to-read information from several sources.
Syntax : $ inxi -Fx
Isblk
It displays information about all block devices, such as optical and flash drives.
Syntax : $ lsblk
Df
It reports the disk space available on the filesystem with each file name’s argument.
Syntax : $ df -H
Pydf
This command is an improved df version used to display coloured output.
Syntax : $ pydf
Fdisk
This command is used to create and manipulate disk partition tables. So, you can view, create, delete, change, resize, copy, and move partitions on a hard drive using the dialogue-driven interface.
Syntax : $ sudo fdisk -l
Mount
This command is used to mount and unmount a file system.
Syntax : $ mount | column -t
Using grep
With grep, you can filter the file system that you want to see.
Syntax : $ mount | column -t | grep ext
Free
This command is used to Check the amount of use, free and total amount of RAM on the system.
Syntax : $ free -m
Dmidecode
This command differs from the other commands because it extracts hardware information by reading data from the DMI tables.
CPU info
You can use the command below to see information about the CPU.
Syntax : $ sudo dmidecode -t processor
Ram info
You can use the command below to see information about Memory.
Syntax : $ sudo dmidecode -t memory
Bios info
You can use the command below to see information about bios.
Syntax : $ sudo dmidecode -t bios
/proc files
Most files in the /proc directory contain data about hardware and configurations. Let’s check out some of them:
CPU and Memory info
You can use the commands below to see information about CPU and Memory.
Syntax : $ cat /proc/cpuinfo
Syntax : $ cat /proc/meminfo
Kernel info
You can use the command below to see information about the Linux kernel.
Syntax : $ cat /proc/version
SCSI devices
Small Computer Systems Interface, SCSI, allows you to add up to 15 peripheral devices to the computer. And you can use the command below to see information about SCSI.
Syntax : $ cat /proc/scsi/scsi
Partitions
You can use the command below to see information about partitions.
Syntax : $ cat /proc/partitions
Hdparm
This command is used to show information about Sata devices like hard disks.
Syntax : $ sudo hdparm -i /dev/sda
Conclusion
- Checking hardware information on Linux is crucial for system administrators.
- Checking your hardware’s information can be done with commands including Iscpu, hwinfo, and lspci.
- Using these commands lets you get information about every part of your computer’s hardware.
You can also buy linux server to practice it on a routine basis.
FAQ
What command can be used to show system hardware information in Linux?
The ‘lshw’ command is typically used to show system hardware information in Linux.
What type of information can be seen using the ‘lshw’ command?
The ‘lshw’ command can see detailed information about installed hardware components, such as memory, processor, hard disk and network interfaces.
Is the ‘lshw’ command available in all Linux distributions?
Yes, the ‘lshw’ command is available in all Linux distributions.
How can the output of the ‘lshw’ command be formatted?
The output of the ‘lshw’ command can be formatted into HTML, XML and plain text formats using the -html, -xml and -sanitize options, respectively.
People also read:
Nisal N
Computers has always fascinated me since I was a kid and here we are. I love travelling for 2 reasons: the first one to see a new part of the world and second (the most important one) to experience the rich culture hidden among the country and people. I’m pretty good at cooking but very poor when it comes to baking.
Getting information on a machine’s hardware in Linux
On what Operating System ? There is no standard command so anything would be more or less distribution specific.
@jiliargre I wouldn’t say distribution specific but certainly OS, Linux and BSD probably greatly vary here.
6 Answers 6
If your system supports a procfs, you can get much information of your running system. Its an interface to the kernels data structures, so it will also contain information about your hardware. For example to get details about the used CPU you could cat /proc/cpuinfo For more information you should see the man proc.
More hardware information can be obtained through the kernel ring buffer logmessages with dmesg . For example this will give you a short summary of recently attached hardware and how it is integreated in the system.
These are some basic «interfaces» you will have on every distribution to obtain some hardware information.
Other ‘small’ tools to gather hardware information are:
Depending on your distribution you will also have access to one of these two tools to gather a detailed overview of your hardware configuration:
The «gate» to your hardware is thorugh the «Desktop Management Interface» (-> DMI). This framework will expose your system information to your software and is used by lshw for example. A tool to interact directly with the DMI is dmidecode and availible on the most distributions as package. It will come with biosdecode which shows you also the complete availbile BIOS informations.