How to view detailed Linux system and hardware information on the command line

When using Linux, you may need to know details about the system you are running or the hardware specifications you are using. As a normal Linux user or software developer, it is important that you check the compatibility of the software or hardware system you want to install. The Linux command line contains a number of built-in commands to help you become familiar with the software platform and hardware you will be working on. The following tutorial will teach you how to use all these commands.

Displays basic system information on Linux Shell

For basic information about the system, you need to be familiar with the command line utility called uname - short for unix name.

uname command

The uname command comes with many switches. The basic command as described below returns only the Kernel name:

$unname

Output:

How to view detailed Linux system and hardware information on the command line Picture 1

As you can see, the uname command when used without any switches returns only the kernel name.

See Linux kernel name

When you want to know the exact command to output the kernel name, you will use the following command:

$ uname -s

Output:

How to view detailed Linux system and hardware information on the command line Picture 2

The above output showed Linux as the kernel name.

See Linux kernel releases

To print the kernel's release information, use the following command:

$ uname -r

Output:

How to view detailed Linux system and hardware information on the command line Picture 3

The above command displayed the Linux release number in the example

See Linux kernel version

To find the kernel version, use the following command:

 

$ uname -v

Output:

How to view detailed Linux system and hardware information on the command line Picture 4

View network node hostname

You can use the following command to print the network node hostname:

$ uname -n

You can also use the following command for the same purpose as it is more user-friendly:

$ uname --nodename

Output:

How to view detailed Linux system and hardware information on the command line Picture 5

Both commands will show the same output. Please note that hostname and node name may not be the same for non-Linux systems.

See machine hardware architecture (i386, x86_64, etc.)

To know the hardware architecture of the system you are working with, please use the following command:

$ uname --m

Output:

How to view detailed Linux system and hardware information on the command line Picture 6

The x86_64 output indicates that the author is using a 64-bit architecture. i686 output means the user is using a 32-bit system.

See processor type

To know what type of processor you are using, please use the following command:

$ uname -p

Output:

How to view detailed Linux system and hardware information on the command line Picture 7

This result shows that the author is using a 64-bit processor.

See hardware platform

To know the hardware platform you are using, please use the following command:

$ uname -i

Output:

How to view detailed Linux system and hardware information on the command line Picture 8

In the example case, the output is the same as the machine's hardware name.

View operating system information

The following command will tell you the name of the operating system you are using:

$ uname -o

Output:

How to view detailed Linux system and hardware information on the command line Picture 9

The Ubuntu machine in the example displayed the above results for the system.

Find your Linux PC's serial number

Find Linux PC serial number using dmidecode

The easiest way to check your Linux PC serial number is to use dmidecode. After opening Terminal (Ctrl + Alt + T), you can search for your device's serial number with this command:

sudo dmidecode -s system-serial-number

Enter your root password and the command will output your PC's serial number:

 

How to view detailed Linux system and hardware information on the command line Picture 10

This command will not work on all devices. RHEL and CentOS users often encounter problems. If Terminal prompts you saying that SMBIOS implementations newer than version 2.8 are not fully supported by this version of dmidecode, you will need to update your dmidecode with the following DNF package manager command:

dnf update dmidecode

Note: Unfortunately, there is no great way to determine your device's serial number without root permissions.

Use alternate commands to find your PC's serial number

There are several commands besides dmidecode that can help you find your PC's serial number on Linux. If you are using openSUSE, Arch Linux, CentOS, Debian or RHEL, you can also try entering the following command in Terminal:

hwinfo --bios

Of course, you may need to install hwinfo if your device does not have this utility installed. This command will only be successful if your device has a serial number embedded in the BIOS.

How to view detailed Linux system and hardware information on the command line Picture 11

If your motherboard supports Direct Media Interface (DMI), you can also find your PC's serial number with the following command:

sudo cat /sys/class/dmi/id/board_serial

Displays all information of the Uname command

The above commands displayed system information according to the type of switch used. In case you want to see all system information at once, use the following command:

$ uname -a

Output:

How to view detailed Linux system and hardware information on the command line Picture 12

You can see that the output above shows the complete list of system information to the user.

 

Displays detailed information about the hardware

Here, the article will describe the commands, in addition to uname, used to extract detailed hardware information of the system:

View hardware information with lshw

The lshw utility allows you to view important hardware information such as memory, CPU, disk drive, etc. from the system. Please run the following command as superuser to view this information:

$ sudo lshw

Output:

How to view detailed Linux system and hardware information on the command line Picture 13

The result above is a very detailed version of the system hardware information. You can also view a summary of hardware information as described in the following section.

Brief summary of hardware information

To view a detailed hardware configuration summary, please use the following command:

$ lshw -short

Output:

How to view detailed Linux system and hardware information on the command line Picture 14

The output above is a more readable column-wise summary of the hardware configuration.

Create HTML files

The lshw utility also allows you to print your hardware profile to an HTML file as a superuser. Use the following command for this purpose:

$ sudo lshw -html > [filename.html]

For example:

$ sudo lshw -html > hardwareinfo.html

Output:

How to view detailed Linux system and hardware information on the command line Picture 15

The above HTML file was created in the /home/user/ directory.

View CPU information with lscpu

The lscpu utility lists detailed CPU information from the sysfs and /proc/cpuinfo files on the screen. Here's how you can use this command:

$ lscpu

Output:

How to view detailed Linux system and hardware information on the command line Picture 16

The above output shows CPU architecture, number of CPUs, cores, CPU family model, threads, CPU cache, etc.

View blocking device information with lsblk

The lsblk utility displays information about all the underlying storage devices in the system such as the hard drive, its partitions and the flash drives connected to the system.

$lsblk

You can use the following command to see more detailed information about all devices:

$ lsblk -a

Output:

How to view detailed Linux system and hardware information on the command line Picture 17

View USB device information with lsusb

The lsusb command lists information about all USB controllers and the devices connected to them. Please run the following command:

$lsusb

You can also use the following command to view more detailed information about each USB device.

$ lsusb -v

Output:

How to view detailed Linux system and hardware information on the command line Picture 18

This output displays all USB controllers and attached devices.

View information about other devices

You can also view information about the following devices on your system:

  1. PCI devices
$lspci
  1. SCSI devices
$lsscsi
  1. SATA devices
$ hdparm [devicelocation] eg $ hdparm /dev/sda2

After working with this guide, you will never fail to retrieve information about Linux and your system's underlying hardware again. This will help you check the system specifications and whether the potential hardware or software is compatible with your system.

5 ★ | 1 Vote

May be interested

  • Manage the Event Log with the command lineManage the Event Log with the command line
    for many of us, using the command line - command line to control and use some of the functions in the windows system will cause them to have headaches and problems. however, if you have to set up an automatic function system in windows and other server operating systems, the command line is an irreplaceable tool ...
  • The Cat command in LinuxThe Cat command in Linux
    the cat command (short for 'concatenate') is one of the most frequently used commands in operating systems like linux / unix. the cat command allows users to create one or more files, view file contents, join files, and redirect output in a terminal or file.
  • How to print from the Linux command lineHow to print from the Linux command line
    printing documents from the linux command line is easy. you use the lp command to request printing and lpq to see which print jobs are in the queue.
  • 11 uses of ps command in Linux11 uses of ps command in Linux
    for system administrators, ps is a frequently used tool. the ps command is used to list the processes currently running on the system, with many available filtering and display modes via flags and arguments.
  • 20+ essential Linux security commands20+ essential Linux security commands
    here are some of the most important security commands for everyday work on linux systems. if you're interested in security issues on your linux system, don't ignore these helpful security commands.
  • How to schedule Linux commands with 'at'How to schedule Linux commands with 'at'
    utility at very easy to use. users only need to give time and date as command line parameters, then enter one or more commands to execute.
  • How to find the MAC address using the command line in LinuxHow to find the MAC address using the command line in Linux
    today, tipsmake.com will talk about an important command in linux, ip. this command works on all linux distributions, including ubuntu, arch linux, debian, fedora, etc. '
  • How to Restart Debian Using the Command LineHow to Restart Debian Using the Command Line
    the linux operating system can run without a reboot not only for a few weeks but for years. but sometimes there's a good reason to reboot your linux system after a week or two, depending on the situation.
  • View iPhone configuration, check iPhone hardware informationView iPhone configuration, check iPhone hardware information
    see iphone configuration, check iphone hardware information is one of the most important actions when you want to buy an iphone, whether it is genuine or old. this is not simply to help you know the information about the device you are using, but also minimize the risk of buying goods, avoid buying fake goods and poor quality goods.
  • How to check internet speed with the command line in LinuxHow to check internet speed with the command line in Linux
    today, tipsmake.com will read how to check the speed of the internet from the command line via terminal in various popular linux distributions, including ubuntu, fedora and arch linux.