- 16 Commands to Check Hardware Information on Linux
- Hardware information
- 1. lscpu
- 2. lshw — List Hardware
- 3. hwinfo — Hardware Information
- 4. lspci — List PCI
- 5. lsscsi — List scsi devices
- 6. lsusb — List usb buses and device details
- 7. Inxi
- 8. lsblk — List block devices
- 9. df — disk space of file systems
- 10. Pydf — Python df
- 11. fdisk
- 12. mount
- 13. free — Check RAM
- 14. dmidecode
- 15. /proc files
- 16. hdparm
- Summary
- 48 thoughts on “ 16 Commands to Check Hardware Information on Linux ”
- How to Check System Configuration and Hardware Information on Linux
- What’s proc filesystem (procfs)
- 1) How to Check CPU and Processing Units Using the lscpu Command
- 2) How to Check Memory Information Using the free Command
- 2a) How to Check Memory Information Using the /proc/meminfo file
- 2b) How to Check Memory Information Using the vmstat Command
- 3) How to Check PCI Bus Devices Information Using the lspci Command
- 4) How to Check scsi Devices Information Using the lsscsi Command
- 5) How to Check usb Devices Information Using the lsusb Command
- 6) How to Check Black Devices Information Using the lsblk Command
- 7) How to Check Linux System Hardware Information Using the Dmidecode Command
- 8) How to Check Linux System Hardware Information Using the inxi Command
- 9) How to Check Linux System Hardware Information Using the lshw Command
- 10) How to Check Linux System Hardware Information Using the hwinfo Command
- 11) How to Check Partition Information Using the df Command
- 12) How to Check Added Hard Disk Size Using the fdisk Command
- 13) How to Check Mounted File Systems in Linux
- 14) How to Check WWN Number of HBA Card Using the fdisk Command
- 15) How to Check Sata Disk Information Using the hdparm Command
- 16) How to Check System Hardware Information Using the /sys Filesystem
- 17) How to Ethernet Device Information Using the ethtool Command
- 18) How to Manage HP Array Controllers Using the hpacucli Command
- 19) How to View HP Servers Information Using the hponcfg Command
- 20) How to View Dell Servers Information Using the getsysinfo Command
- 21) How to Check if a Linux System is a Physical or a Virtual Machine
16 Commands to Check Hardware Information on Linux
Hardware information
Like for every thing, there are plenty of commands to check information about the hardware of your linux system.
Some commands report only specific hardware components like cpu or memory while the rest cover multiple hardware units.
This post takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware peripherals and devices.
The list includes lscpu, hwinfo, lshw, dmidecode, lspci etc.
1. lscpu
The lscpu command reports information about the cpu and processing units. It does not have any further options or functionality.
2. lshw — List Hardware
A general purpose utility, that reports detailed and brief information about multiple different hardware units such as cpu, memory, disk, usb controllers, network adapters etc. Lshw extracts the information from different /proc files.
Check out the following post to learn more about lshw
3. hwinfo — Hardware Information
Hwinfo is another general purpose hardware probing utility that can report detailed and brief information about multiple different hardware components, and more than what lshw can report.
4. lspci — List PCI
The lspci command lists out all the pci buses and details about the devices connected to them.
The vga adapter, graphics card, network adapter, usb ports, sata controllers, etc all fall under this category.
Filter out specific device information with grep.
5. lsscsi — List scsi devices
Lists out the scsi/sata devices like hard drives and optical drives.
6. lsusb — List usb buses and device details
This command shows the USB controllers and details about devices connected to them. By default brief information is printed. Use the verbose option «-v» to print detailed information about each usb port
On the above system, 1 usb port is being used by the mouse.
7. Inxi
Inxi is a 10K line mega bash script that fetches hardware details from multiple different sources and commands on the system, and generates a beautiful looking report that non technical users can read easily.
8. lsblk — List block devices
List out information all block devices, which are the hard drive partitions and other storage devices like optical drives and flash drives
9. df — disk space of file systems
Reports various partitions, their mount points and the used and available space on each.
10. Pydf — Python df
An improved df version written in python, that displays colored output that looks better than df
11. fdisk
Fdisk is a utility to modify partitions on hard drives, and can be used to list out the partition information as well.
12. mount
The mount is used to mount/unmount and view mounted file systems.
Again, use grep to filter out only those file systems that you want to see
13. free — Check RAM
Check the amount of used, free and total amount of RAM on system with the free command.
14. dmidecode
The dmidecode command is different from all other commands. It extracts hardware information by reading data from the SMBOIS data structures (also called DMI tables).
Check out the man page for more details.
15. /proc files
Many of the virtual files in the /proc directory contain information about hardware and configurations. Here are some of them
16. hdparm
The hdparm command gets information about sata devices like hard disks.
Summary
Each of the command has a slightly different method of extracting information, and you may need to try more than one of them, while looking for specific hardware details. However 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.
A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected] .
48 thoughts on “ 16 Commands to Check Hardware Information on Linux ”
How i can check memory in CPU. Example OPT, Efuse
Thanks for this. I’m just getting going on a VPS and this helped me discover they’d not given me the extra 1Gb I ordered. Very well explained.
Super happy with
inxi -Fx
more accurate than some of the other utilities.. for instance hwinfo was inaccurate for my Lenovo
Thanks for the great post!
Thank you! Your descriptions were useful and well explained!
Источник
How to Check System Configuration and Hardware Information on Linux
Users can easily check the configuration of the system hardware on a Windows machine by opening the Computer Information app.
This can be easily verified on the Linux machine via the GUI. But on a headless Linux system it is not so easy to verify this information.
Linux has plenty of commands to check for system configuration and hardware information.
But not all tools will show you the same information, each tool is designed for a specific purpose and they do their job well.
Some of these commands provide all the information. We will show you all the commands and their details.
On Linux, most system hardware information is stored under the “/proc” file system.
What’s proc filesystem (procfs)
The proc filesystem (procfs) is a special filesystem in Unix-like operating systems that presents information about processes and other system information.
It’s sometimes referred to as a process information pseudo-file system. It doesn’t contain ‘real’ files but run time system information (e.g. system memory, devices mounted, hardware configuration, etc).
1) How to Check CPU and Processing Units Using the lscpu Command
The lscpu command display information about the CPU and processing units. It gathers CPU architecture information from sysfs, and other information from /proc/cpuinfo file.
The below output shows the following information, for example, the number of CPUs, threads, cores, sockets, and Non-Uniform Memory Access (NUMA) nodes. There is also information about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, and stepping.
The above command shows a consolited output of CPU processor and run the following command to see each CPU processor information.
You can easily count the number of CPUs using the following command.
2) How to Check Memory Information Using the free Command
The free command is widely used by Linux administrator to check Linux system memory, it’s very simple and displays the total amount of free and used physical and swap memory in the system, as well as the buffers and caches used by the kernel.
2a) How to Check Memory Information Using the /proc/meminfo file
The /proc/meminfo is a virtual text file that contains a large amount of valuable information about the systems RAM usage.
It’s report the amount of free and used memory (both physical and swap) on the system.
Run the below command to see the memory output with GB instead of KB.
Run the below command to see only total memory output with GB instead of KB.
Run the below command to see the memory output with MB instead of KB.
Run the below command to see only total memory output with MB instead of KB.
2b) How to Check Memory Information Using the vmstat Command
The vmstate command report virtual memory statistics. It reports information about processes, memory, paging, block IO, traps, disks and cpu activity.
3) How to Check PCI Bus Devices Information Using the lspci Command
The lspci stands for list PCI devices. lspci command is used to display information about PCI buses in the system and hardware devices that are connected to PCI and PCI bus.
It will display information about model number/chip details for devices like PCI bridge, VGA controller, Ethernet controller, USB controller, Audio device, IDE interface, etc.
Details of the above output: Each line comes with three parts, it’s described below in detail.
- PCI bus slot number: 09:00.0
- PCI slot name: Ethernet controller
- Device Manufacturer Name and Model Number: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
Information on PCI-related devices are stored in the file below.
4) How to Check scsi Devices Information Using the lsscsi Command
The lsscsi stands for list small Computer System Interface. The lsscsi command lists information about SCSI/Sata devices attached to the system.
It’s scans the sysfs (mounted at /sys) pseudo file system to gather information, which was introduced in the 2.6 Linux kernel series.
5) How to Check usb Devices Information Using the lsusb Command
The lsusb stands for list Universal Serial Bus or USB. It’s display information about USB buses in the system and the devices connected to them.
This will display a list of all USB devices connected to your computer such as keyboards, mouse, printers, disk drives, network adapters, etc,.
Details of the above output: Each line comes with four parts, it’s described below in detail.
- Bus 001: Bus Number
- Device 001: Device Number
- ID 1d6b:0002: The ID comes with two parts. The first part is showing “Manufacturer ID” and the second part is showing “Device ID”.
- Linux Foundation 2.0 root hub: Device Manufacturer Name and Model Number.
Information on USB-related devices are stored in the file below.
6) How to Check Black Devices Information Using the lsblk Command
The lsblkk stands for list block devices. It’s display information about block devices (except RAM disks). Block devices are hard disk partition, flash drives, CD-ROM, optical drives, etc,.
7) How to Check Linux System Hardware Information Using the Dmidecode Command
Dmidecode is a tool which reads a computer’s DMI (stands for Desktop Management Interface) (some say SMBIOS – stands for System Management BIOS) table contents and display system hardware information in a human-readable format.
This table contains a description of the system’s hardware components, as well as other useful information such as serial number, Manufacturer information, Release Date, and BIOS revision, etc,.
8) How to Check Linux System Hardware Information Using the inxi Command
inxi is a nifty tool to check hardware information on Linux and offers wide range of option to get all the hardware information on Linux system that i never found in any other utility which are available in Linux.
It was forked from the ancient and mindbendingly perverse yet ingenius infobash, by locsmif.
9) How to Check Linux System Hardware Information Using the lshw Command
lshw (stands for Hardware Lister) is a small nifty tool that generates detailed reports about various hardware components on the machine such as memory configuration, firmware version, mainboard configuration, CPU version and speed, cache configuration, usb, network card, graphics cards, multimedia, printers, bus speed, etc.
10) How to Check Linux System Hardware Information Using the hwinfo Command
hwinfo stands for hardware information tool is another great utility that used to probe for the hardware present in the system and display detailed information about varies hardware components in human readable format.
It reports information about CPU, RAM, keyboard, mouse, graphics card, sound, storage, network interface, disk, partition, bios, and bridge, etc. This tool could display more detailed information among others like lshw, dmidecode, inxi, etc,.
11) How to Check Partition Information Using the df Command
df command stands for Disk Filesystem. It shows detailed report of disk space usage on the Linux system.
It displays the amount of total disk space, available disk space, used disk space, disk used percentage and mounted filesystem on the Linux system.
12) How to Check Added Hard Disk Size Using the fdisk Command
fdisk stands for fixed disk or format disk is a cli utility that allow users to perform following actions on disks. It allows us to view, create, resize, delete, move and copy the partitions.
It understands MBR, Sun, SGI and BSD partition tables and it doesn’t understand GUID Partition Table (GPT) and it is not designed for large partitions.
fdisk allows us to create a maximum of four primary partitions per disk. One of these may be an extended partition and it holds multiple logical partitions.
13) How to Check Mounted File Systems in Linux
These commands display the list of currently mounted file systems with details.
14) How to Check WWN Number of HBA Card Using the fdisk Command
Systool is a tool that uses APIs provided by libsysfs to gather information, view system device information by bus, class, and topology. It runs only on linux systems running kernels 2.5 or later, with the sysfs filesystem mounted.
Run the following command to find the WWN numbers for your fc host.
15) How to Check Sata Disk Information Using the hdparm Command
The hdparm command gets information about sata devices (hard disks).
16) How to Check System Hardware Information Using the /sys Filesystem
The kernel expose some DMI information in the /sys virtual filesystem. So we can easily get the machine type by running grep command with following format.
17) How to Ethernet Device Information Using the ethtool Command
ethtool is used to query and control network device driver and hardware settings, particularly for wired Ethernet devices.
Run the following commands to know about wifi kernel driver, firmware version and bus info.
18) How to Manage HP Array Controllers Using the hpacucli Command
Hpacucli is used to create, delete and repair the logical and physical drives on the smart array controllers in HP servers.
19) How to View HP Servers Information Using the hponcfg Command
HPONCFG is an online configuration tool used to set up and reconfigure iLO without requiring a reboot of the server operating system. The utility runs in a command-line mode and must be executed from an operating system command line on the local server. HPONCFG enables you to initially configure features exposed through the RBSU or iLO.
20) How to View Dell Servers Information Using the getsysinfo Command
The Dell RACADM (Remote Access Controller Admin) utility is a command line tool that allows for remote or local management of Dell Servers.
RACADM commands allow you to view managed system information, perform power operations on the managed system, perform firmware updates, configure settings and more.
21) How to Check if a Linux System is a Physical or a Virtual Machine
These commands allow you to check whether a Linux system is a physical or virtual machine.
There are many ways we can identify this. To do so, go to the following article.
Источник