Linux about this computer

List of Commands to get Linux system info using terminal

In Linux, we can use the command terminal to check various system hardware configurations and information such as CPU, Memory, hard disk, etc., and here are those to use…

Although there are tools that can display Linux system info graphically, however, here we are going to use the inbuilt commands.

The question of how a system is equipped and how it performs in harsh everyday life is not only of theoretical interest. Lot’s of time to solve a problem we need to know hardware and its utilization to remove some bottleneck. Thus, if you are new to Linux systems or running any cloud server where you want to know about the system load, the network interface, and type of processor and chipset, or what hardware is actually in the system? Then here some top commands to follow…

Commands to View Linux System info using terminal

Here we are using Ubuntu 20.04 to display the results of the Linux system info commands, however, you can use them on older versions such as Ubuntu 18.04/16.04 including RPM-based distros like CentOS and RHEL. Apart from them, others are also supported such as Debian, Linux Mint, Kali, Elementary OS, Manjaro, and more.

1. Check Linux system CPU info and Virtualization support

To check out the full information of Linux system’s CPU such as Type of Architecture (i386, x86_64, etc.) (32-bit or 64-bit), Socket, Cores per socket, CPU speed, L cache, Virtualization type or support, etc. use the below given single command:

Furthermore, you can also check each CPU in detail (CPU model, frequency, etc.) of your computer, laptop, or server using:

Output:

2. Know about Linux System RAM details

Check out free Memory on your Linux system along with details of its size and hardware information.

To print free available RAM, type:

Those who are interested in full detail such as Total Memory, Free Memory, Buffers, Cache, Swap cached, Active, mapped, and more… can go for this one:

To identify each RAM used on each memory slot of your system’s motherboard, print the Memory Controller information using the dmidecode command:

3. Find out BIOS Info on Linux using Dmidecode

Dmidecode dumps the DMI (Desktop Management Interface) information of the machine in a readable way. This information includes hardware and BIOS.

Читайте также:  Directx 12 windows 10 64 bit offline installer

You can get the current configuration and the maximum configuration supported by the system, such as the maximum amount of memory supported that we already have shown above…

Therefore, here are some uses of the dmidecode command to know further details of the system as well such as BIOS version, motherboard, and processor.

If you want to view all Linux useful system information use this one. However, it will give a lot of information.

4. Command to view hard disk and partition distribution

Do you want to know about each size of Hard disk and partition available? Then use-

OutPut:

Furthermore, those who want to dig more on hard disk and partitions, then to have each detail of the installed drives run fdisk -l with sudo rights:

Output

To get a clear view and all information along with the type of file system and partitions mounted points, we can also use:

Mount points can be further elaborated with:

5. Check Network card information

The network card installed on our Linux system is one of the important components to connect the internet and other local networks. However, to know its model, manufacturer, and other information without operating the system’s case, use the below-given commands.

Find out the IP address and available active ethernet interfaces:

Now, after using the above command you get the IP address and active ethernet interface, just use that with the below command. For example, ens33 is our interface.

The ethtool will show all information about the network card bandwidth such as what is the max speed, supported link modes, ports, and more…

To get network information we can also use Net-tools, however, we need to install it because by default it would not available on the system.

For Debian/Ubuntu: sudo ap tinstall net-tools
For RHEL/CentOS/Fedora– sudo yum install net-tools or sudo dnf install net-tools

To know Ipaddress:

For getting details of active connections, protocols, domain sockets, and more…

6. View PCI Slots information on Linux system

PCI slots, where we use graphic cards, network cards, and other third-party hardware directly on the Motherboard. To know about these PCI hardware slots run:

If you want more detailed information: lspci -v or lspci -vv

To see the device tree: lscpi -t

6. USB controllers and attached devices

View the details of USB slots and the devices plugged into them using lsusb command:

To have detailed info on USB slots and their active devices use :

7. Command to get complete Linux OS information

When we are running a Linux server and after upgrading or having installation, in case we want to know what version of Linux operating system we are using then, that is possible as well using the command terminal.

Get release info only:

8. Command to get Linux Kernel Information

A kernel, which is the core part of our Linux system, to check out which version we on before updating or after, run:

9. View Real-time processes

To go a bit further and know PID (Process ID, Unique number of the process) of the process executed on the system along with what is currently active we can use two commands:

To check out the PID (Process ID, Unique number of the process) of the process.

Real-time display of process status

A top is a text-based tool that gives complete information of currently active processes in real-time. To exit it, press Ctrl+C.

Читайте также:  Как использовать cmake linux

9. Complete Linux System Hardware Information

Here is the one final command that can give all the hardware information of your Linux system in a single shot. However, displaying all data in one place may feel clutter but if you don’t want to use multiple commands, then this one is for you.

Those who want to omit the slight unwanted information can use the same command with a short flag.

The good thing, if you want to print or save your Linux system hardware information in HTML format then that is also possible using lshw, simply run:

you will see the created file.

Now, open your browser and type or paste: file:///home/ubuntu/lshw-info.html

Closing thoughts:

So, these were some common commands we can use to find out Linux system info on CPU, Memory, OS, kernel, Network, and more. Although, these are not the only there are so many others, so keep searching this big world of Linux. If you know some commands to get a better view of the Linux system then the comment section is all yours…

Источник

Get Linux System and Hardware Details 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 for you to check the compatibility of a software or hardware system you want to install. The Linux command line contains several built-in commands to help you become familiar with the software and hardware platform you are working on. This tutorial will teach you how to use all these commands to get the sysinfo Linux details.

The commands and examples mentioned in this tutorial have been tested on Ubuntu 20.04 and Debian 10.

Displaying Basic System Information on Linux Shell

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

The uname Command

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

Output:

As you can see, the uname command when used without any switches only returns the kernel name i.e., Linux for my system.

Get the Linux Kernel Name

When you precisely want the command to print the kernel name, you will use the following command:

Output:

The above output has displayed Linux as my kernel name.

Get the Linux Kernel Release

In order to print the release information of your kernel, use the following command:

Output:

The above command has displayed the release number of my Linux

Get the Linux Kernel Version

In order to fetch the version of your kernel, use the following command:

Output:

The above output shows the version number of my kernel.

Get Network Node Hostname

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

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

Output:

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

Get Machine Hardware Architecture (i386, x86_64, sysinfo Linux)

In order to know the hardware architecture of the system you are working on, please use the following command:

Output:

The output x86_64 signifies that I am using a 64-bit architecture. The output i686 means that a user is on a 32-bit system.

Читайте также:  Windows для sandy bridge

Get Processor Type

In order to know the type of processor you are using, please use the following command:

Output:

This output shows that I am using a 64-bit processor.

Get Hardware Platform

In order to know the hardware platform you are using, please use the following command:

Output:

In my case, the output is the same as that of the machine hardware name.

Get Operating System information

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

Output:

My Ubuntu machine has displayed the above output for my system.

Displaying All Information of Uname Command

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

Output:

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

Displaying Detailed Hardware Information

Here we will describe the commands, other than uname, that are used to extract detailed hardware information of your system:

Get Hardware Information with lshw

The lshw utility enables you to fetch important hardware information such as memory, CPU, disks, etc. from your system. Please run the following command as a super user in order to view this information:

Output:

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

Short Summary

In order to view the summary of your detailed hardware profile, please use the following command:

Output:

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

Creating an HTML File

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

Output:

The above HTML file has been created at the /home/user/ folder.

Get CPU Information with lscpu

The lscpu utility lists detailed CPU information from the files sysfs and /proc/cpuinfo to your screen. This is how you can use this command:

Output:

The above output displays CPU architecture, number of CPUs, cores, CPU family model, threads, CPU caches and much more.

Get Block Device Information with lsblk

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

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

Output:

Get USB Device Information with lsusb

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

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

Output:

This output displays all the USB controllers and the attached devices.

Get Information About Other Devices

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

  • PCI devices

After practicing along with this tutorial, you will never fail to retrieve sysinfo about Linux and the underlying hardware of your system. This will help you check the system specifications and whether or not prospective hardware or software is compatible with your system.

Karim Buzdar

About the Author: 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. You can reach Karim on LinkedIn

Источник

Оцените статью