Linux system information command

Смотрим информацию о системе в Linux (Ubuntu, CentOS, Fedora)

Тем кто только-только пересел с операционной системы Windows на более сложный Linux, порой бывает сложно выполнить те операции, которые на знакомой ОС делались за пару секунд.
Одна из подобных задач — посмотреть основную информацию о системе: какой стоит процессор, материнская плата, версия операционной системы, разрядность, ядро и т.п. В старой доброй Windows достаточно было вывести свойства системы или открыть диспетчер задач. А тут всё сложнее. Но вся сила Линукс — в консоли и есть ряд специальных команд командой строки, которые помогут узнать всю необходимую информацию о Вашей ОС Linux, будь то Ubuntu, CentOS, Fedora или иной дистрибутив. Сейчас я Вам их покажу!

hwinfo — эта утилита выдаёт массу информации о комплектующих: процессоре, материнской плате, оперативной памяти, видеокарте, жесткому диску и т.п. К сожалению, не во всех дистрибутивах она присутствует, но установить ещё случай чего — проще простого:
— в Debian, Ubuntu: sudo apt-get install hwinfo
— в Fedora и Red Hat: yum install hwinfo

Чтобы вывести основную информацию, воспользуйтесь ключом —short.

lshw — эта команда выдаёт полную информацию о аппаратной части компьютера или ноутбука.

Конечно, до уровная утилиты hwinfo ещё далеко, но основную информацию получить вполне реально. Команда lshw выполняется с правами рута — sudo lshw.

cat /proc/cpuinfo — вывод полной информации о процессоре, установленном на ПК.

cat /proc/meminfo — подробные данные о полном объёме оперативной памяти, сколько её занято и сколько свободно.

free -m — команда похожа по результату на предыдущую, за тем лишь результатом, что вывод будет в виде небольшой таблицы.

lspci | grep VGA — эта директива отобразит информацию по установленной видеокарте.

lspci | grep Audio — смотрим какая на компьютере установлена звуковая карта.

df -H — подробная информация по разделам жесткого диска, их объём и текущая загрузка.

lspci | grep Ethernet — модель и производитель сетевого адаптера ПК.

uname -a — эта команда отобразит в консоли основные данные по операционной системе Linux — версию ядра, дистрибутива, а так же используемую архитектуру — 32 или 64 бита).

uname -r — выводится информация о версии ядра ОС.

cat /proc/version — вывод команды полностью аналогичен предыдущей.

lsb_release -a — здесь в качестве результата выполнения команды будет название установленного дистибутива Линукс и его версия:

cat /etc/*release* — результат выполнения команды будет во много аналогичным предшествующей директиве. То есть будет показана инфа о дистрибутиве и его версии.

Важное отличие — если Вы используете ОС построенную на каком либо дистрибутиве, то команда отобразить и информацию о базовом дистрибутиве Линукс.

ls -clt / | tail -n 1 | awk ‘< print $7, $6, $8 >’ — эта команда отобразит Вам дату и время установки системы.

ls -dl /var/log/installer/ — эта команда Linux так же позволяет узнать дату и время установки системы.

cat /etc/issue — результат выполнения команды аналогичен предыдущей. Вам будет показана версия дистрибутива ОС.
С помощью этого списка основных команд Вы сможете без проблем посмотреть и узнать основную информацию о ПК и операционной системе.

Читайте также:  Windows 10 статистика работы

Источник

How to Get Hardware Info on Linux

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.

Читайте также:  Настройка vnc ubuntu windows

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.

Источник

10 Commands to Collect System and Hardware Info in Linux

It is always a good practice to know the hardware components of your Linux system is running on, this helps you to deal with compatibility issues when it comes to installing packages, drivers on your system using yum, dnf, or apt.

10 Commands to Check Hardware and System Information in Linux

Therefore in these tips and tricks series, we shall look at some useful commands that can help you to extract information about your Linux system and hardware components.

1. How to View Linux System Information

To know only the system name, you can use the uname command without any switch that will print system information or the uname -s command will print the kernel name of your system.

To view your network hostname, use the ‘-n’ switch with the uname command as shown.

To get information about kernel-version, use the ‘-v’ switch.

To get the information about your kernel release, use the ‘-r’ switch.

To print your machine hardware name, use the ‘-m’ switch:

All this information can be printed at once by running the ‘uname -a’ command as shown below.

2. How to View Linux System Hardware Information

Here you can use the lshw tool to gather vast information about your hardware components such as cpu, disks, memory, usb controllers, etc.

lshw is a relatively small tool and there are few options that you can use with it while extracting information. The information provided by lshw was gathered from different /proc files.

Note: Do remember that the lshw command is executed by the superuser (root) or sudo user.

Читайте также:  Linux форматируем жесткий диск

To print information about your Linux system hardware, run this command.

You can print a summary of your hardware information by using the -short option.

If you wish to generate output as an html file, you can use the option -html.

Generate Linux Hardware Information in HTML

3. How to View Linux CPU Information

To view information about your CPU, use the lscpu command as it shows information about your CPU architecture such as a number of CPUs, cores, CPU family model, CPU caches, threads, etc from sysfs and /proc/cpuinfo.

4. How to Collect Linux Block Device Information

Block devices are storage devices such as hard disks, flash drives, etc. lsblk command is used to report information about block devices as follows.

If you want to view all block devices on your system then include the -a option.

5. How to Print USB Controllers Information

The lsusb command is used to report information about USB controllers and all the devices that are connected to them.

You can use the -v option to generate detailed information about each USB device.

6. How to Print PCI Devices Information

PCI devices may include usb ports, graphics cards, network adapters, etc. The lspci tool is used to generate information concerning all PCI controllers on your system plus the devices that are connected to them.

To print information about PCI devices run the following command.

Use the -t option to produce output in a tree format.

Use the -v option to produce detailed information about each connected device.

7. How to Print SCSI Devices Information

To view all your scsi/sata devices, use the lsscsi command as follows. If you do not have the lsscsi tool installed, run the following command to install it.

After installation, run the lsscsi command as shown:

Use the -s option to show device sizes.

8. How to Print Information about SATA Devices

You can find some information about sata devices on your system as follows using the hdparm utility. In the example below, I used the block device /dev/sda1 which is the hard disk on my system.

To print information about device geometry in terms of cylinders, heads, sectors, size, and the starting offset of the device, use the -g option.

9. How to Check Linux File System Information

To gather information about file system partitions, you can use the fdisk command. Although the main functionality of the fdisk command is to modify file system partitions, it can also be used to view information about the different partitions on your file system.

You can print partition information as follows. Remember to run the command as a superuser or else you may not see any output.

10. How to Check Linux Hardware Components Info

You can also use the dmidecode utility to extract hardware information by reading data from the DMI tables.

To print information about memory, run this command as a superuser.

To print information about the system, run this command.

To print information about BIOS, run this command.

To print information about the processor, run this command.

Summary

There are many other ways you can use to obtain information about your system hardware components. Most of these commands use files in the /proc directory to extract system information.

Hope you find these tips and tricks useful and remember to post a comment in case you want to add more information to this or if you face any difficulties in using any of the commands. Remember to always stay connected to Tecmint.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

We are thankful for your never ending support.

Источник

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