Have or bought a new PC with Linux pre-installed? or simply need to gather information about your hardware?
Linux is just like windows 7,8 and even XP. It is an operating system. Linux is a Unix like computer operating system. Linux is one of the most used open source operating system. It’s different from Windows because of the command functionality it offers. It’s always good to know the hardware components your system is running on. This information helps you deal with compatibility issues when installing new software, drivers, games, etc. Unlike windows,the user needs to remember some terminal commands to access hardware information on Linux. But remembering all of them can be a pain for some of us. So here, in this article we have listed out a few commonly used commands that will help you Check the Hardware information of your Linux system.
As hinted by the last three letters, the Linux command lscpu reports information about the CPU. Like CPU architecture,number of CPUs, threads, cores, sockets, Non-Uniform Memory Access (NUMA) nodes,CPU caches, CPU family, model,etc. The command gathers information from sysfs and /proc/cpuinfo. This command output can be optimized for parsing or for easy readable for humans.
It is a small command. The command lshw also known as Hardware lister command helps you gather vast information of different hardware components connected to your Linux system. It will report about hardware components such as cpu, disks, memory, usb controllers etc. Lshw extracts the information from different /proc files.
This is another command that reports detailed information about multiple connected hardware components. hwinfo gathers and reports back more information than what lshw command can. Hwinfo depends on the libhd library to gather hardware information.
PCI devices. lspci is a command that displays information about all PCI buses in the system. And also all devices connected to them. PCI devices may include Graphics cards, network adapters and usb ports.
This command is not installed by default in Ubuntu. You can install it by running the command
"sudo apt-get install inxi"
Inxi is a script that fetches a lot of hardware information from different sources. More importantly it reports information in an easy to read format even for the non-technical heads.
This is another command that reports hardware information including the socket type, vendor name and various flags. But it’s bit different than all other commands as dmidecode extracts hardware information by reading data from the DMI tables AKA SMBOIS data structures.
lsscsi – List scsi devices. The following command lists out the scsi/sata devices like hard drives and optical drives. It uses information in sysfs to list scsi devices. Device sizes can be obtained by using the -s option.
USB devices. lsusb is an utility command for displaying information about USB buses/controllers in the system. And like lspci it also lists all the devices connected to them. It also has added options like -v,-s,-t, etc. which can be used to filter the results or get more detailed information.
df is “disk filesystem“ command used to print information about various partitions, their mount points and the used and available space on each. You can run df with the -H parameter. Using the parameter display an easy to read and understand format, it gives the details in bytes, mega bytes and gigabyte.
The fdisk command can be used to view information about the different partitions on your file system. The main functionality of this command is to modify file system partitions
The free command helps you check the amount of used, free and total amount of RAM on your system.
You can find some information about sata devices like hard disks on your system using the hdparm utility. The -g command is used for print information about device geometry in terms of cylinders, heads, sectors, size and the starting offset of the device.
In addition to the above mentioned commands you can get more information about your hardware using commands like –
lsblk : The lsblk command displays a list of available block devices. pydf : It is a python script that displays the amount of disk space available on the mounted filesystems. mount : This command mounts a storage device or filesystem, making it accessible at a certain point in the Linux directory tree. ,/proc files,etc. Another method to get information would be to use gui tools from your commands and avoid the hassle to memorize the commands.
In conclusion there are various commands with each having their own uniqueness to get hardware information on Linux. And feel free to drop a comment if any of the commands didn’t work as described so we can help. Share our article with your fellow Linux administrators and bookmark geekeasier.com as you might come back again looking for something else. Cheers 🙂