- How can I find my hardware details?
- 19 Answers 19
- Graphics:
- Audio:
- Networking:
- How to Get Hardware Info on Linux
- Fetching Basic System Information through the Uname Command
- The default behavior of the uname command
- Printing Kernel Name through uname
- Printing Kernel Release through uname
- Printing Kernel Version through uname
- Printing Machine Hardware Name through uname
- Printing Network Node Hostname through uname
- Printing Processor Type through uname
- Printing Hardware Platform through uname
- Printing Operating System name through uname
- Printing All the above information through uname
- Fetch Detailed Hardware Information
- Fetching Hardware Picture through the lshw command
- Fetching CPU Information through lscpu
- Fetching Block Device Information through lsblk
- Fetching USB Controllers Information through lsusb
- About the author
- Karim Buzdar
How can I find my hardware details?
Is there any built-in software or terminal method allowing me to view the hardware profiles on my system? Windows equivalent of such a feature would be Device Manager.
19 Answers 19
- lspci will show you most of your hardware in a nice quick way. It has varying levels of verbosity so you can get more information out of it with -v and -vv flags if you want it. The -k argument is a good way to find out which kernel driver a piece of hardware is using. -nn will let you simply know the hardware ID which is great for searching. But it is only a very simple, quick way of getting a list of hardware. I often ask people to post the output of it here when trying to identify their wireless hardware. It’s great for things like that. It doesn’t show USB hardware other than the USB busses. Here are three real world examples:
Graphics:
$ lspci -nnk | grep VGA -A1 03:00.0 VGA compatible controller [0300]: NVIDIA Corporation GF110 [GeForce GTX 580] [10de:1080] (rev a1) Kernel driver in use: nvidia
Audio:
$lspci -v | grep -A7 -i "audio" 00:01.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Kabini HDMI/DP Audio Subsystem: Acer Incorporated [ALI] Device 080d Flags: bus master, fast devsel, latency 0, IRQ 34 Memory at f0940000 (64-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel -- 00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 02) Subsystem: Acer Incorporated [ALI] Device 080d Flags: bus master, slow devsel, latency 32, IRQ 35 Memory at f0944000 (64-bit, non-prefetchable) [size=16K] Capabilities: Kernel driver in use: snd_hda_intel Kernel modules: snd_hda_intel
Networking:
$ lspci -nnk | grep net -A2 00:0a.0 Ethernet controller [0200]: NVIDIA Corporation MCP79 Ethernet [10de:0ab0] (rev b1) Subsystem: Acer Incorporated [ALI] Device [1025:0222] Kernel driver in use: forcedeth -- 05:00.0 Ethernet controller [0200]: Atheros Communications Inc. AR242x / AR542x Wireless Network Adapter (PCI-Express) [168c:001c] (rev 01) Subsystem: AMBIT Microsystem Corp. AR5BXB63 802.11bg NIC [1468:0428] Kernel driver in use: ath5k
Of course this is usually a lot of information. You often only need info on a small subset of your hardware and lshw will let you select a category. If you just wanted to see your network devices, for example, run this:
sudo apt-get install hardinfo
How to Get Hardware Info on Linux
Linux users, especially administrators, need to know accurate information about the hardware platform they are using. This helps them in installing not only compatible software but also hardware components according to the system they are on. Linux has both built-in and easily installable commands that can be used to fetch the required system and hardware details. This article explains the usage of some of these commands to enable you in knowing all about your Linux system.
The commands mentioned in this article have been run on a Debian 10 Buster system but they can be replicated easily on most Linux distros.
We will be using the Debian command line, the Terminal, to fetch all the hardware information. You can open the Terminal application by entering the keywords ‘Terminal’ in the Application Launcher search as follows:
Use the Super/Windows key to access the Application Launcher.
Fetching Basic System Information through the Uname Command
The uname command, short for unix name, in Linux is used to print operating system and hardware information through the command line. Here is the syntax of the uname command:
By using various option switches with the command, you can choose to print either all or some specific information about your system.
The default behavior of the uname command
When you use the uname command without any switch, it prints the Linux Kernel name running on your system. Here is how you would use the command:
You can see how the uname command prints my Kernel name, which is Linux.
Printing Kernel Name through uname
Now, if you particularly want the uname command to print the Kernel name, you can use the -s switch with the command as follows:
We need to use the -s option in the scenario where we want to print the Kernel name along with some other information by using more than one switch.
Printing Kernel Release through uname
If you want the uname command to print the Kernel release you are using, you can use the -r switch with the command as follows:
You can see how the output prints the release number of the Linux kernel I am running.
Printing Kernel Version through uname
If you want the uname command to print the Kernel version you are using, you can use the v switch with the command as follows:
You can see how the output prints the version number of the Linux kernel I am running.
Printing Machine Hardware Name through uname
Using the -m switch with the uname command prints the hardware name of your machine.
This lets you know the hardware architecture of your system.
If you see x86_64 as the output, you are using a 64-bit machine. The output i686 indicates that you are using a 32-bit architecture.
Printing Network Node Hostname through uname
Using the -n switch with the uname command prints the node name/hostname of your system. The hostname is the identification that a system uses to communicate on a network.
The output of the uname command with the -n switch is the same as that of the ‘hostname’ command.
Printing Processor Type through uname
You can use the uname command as follows with the -p switch in order to print the processor type:
The above command did not produce a valid output on my Debian but it gives accurate information on Ubuntu.
Printing Hardware Platform through uname
The uname command with the -i switch is used to print the hardware platform you are on.
The above command also did not produce a valid output on my Debian but it gives accurate information on Ubuntu.
Printing Operating System name through uname
The uname command with the -o switch prints the operating system name that you are running.
The output of this command is GNU/Linux on all Linux distros.
Printing All the above information through uname
If you want the uname command to print all the information mentioned above, you can of course use the command with all the switches. The simple way, however, is to use only the -a switch with the uname command as follows:
You can see how the output displays all the information we have printed above, one by one.
Fetch Detailed Hardware Information
In this section, we will explain some more commands through which you can print a complete picture of your hardware specifications and also that of some individual hardware components.
Fetching Hardware Picture through the lshw command
Lshw, short for list hardware, is a command line utility that is used to print information about the hardware components of your system. It fetches information like CPU type & speed, disks, memory, bus speed, firmware, cache, etc, from the /proc files. If your system does not have this utility installed by default, you can install it through the following command as an administrator:
You can then fetch a detailed hardware report through the following command:
Running the command as sudo gives you access to the confidential information about the system.
If you are looking for a summary of the above information, you can get it through the following lshw usage:
You can see how the command prints a better readable hardware profile in a column-wise format.
You can print the output of the lshw command to an html file for sharing or for later use.
Run the following command as sudo in order to do so:
The html is saved in the current user’s home folder by default and this is how it looks like:
Fetching CPU Information through lscpu
The lscpu command fetches detailed CPU information from the /proc/cpuinfo and sysfs files. This is the exact command you will be using:
Fetching Block Device Information through lsblk
The lsblk command fetches detailed block device information such as your hard drives, flash drives, and their partitions. This is the exact command you will be using:
For even more information, you can use the following command:
Fetching USB Controllers Information through lsusb
The lsusb command fetches and prints detailed USB controllers information along with the connected hardware. This is the exact command you will be using:
For even more information, you can use the following command:
Here are some of the other commands you can use to get information about a particular kind of device:
Command | Information |
$ lspci | Fetch information about PCI devices connected to your system |
$ lsscsi | Fetch information about SCSI devices connected to your system |
$ hdparm [device_location] | Fetch information about SATA devices connected to your system. For example, use the command $ hdparm /dev/sda1 for information about sda 1 |
This was all you needed to know about printing all or specific system and hardware information on your Linux.
About the author
Karim Buzdar
Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.