Info about device linux

Содержание
  1. 16 команд для проверки аппаратной части компьютера в Linux
  2. Информация о комплектации компьютера
  3. 1. lscpu
  4. 2. lshw – список аппаратных устройств
  5. 3. hwinfo – информация об аппаратуре компьютера
  6. 4. lspci – список устройств PCI
  7. 5. lsscsi — список устройств scsi
  8. 6. lsusb – подробный список шин и устройств usb
  9. 7. Inxi
  10. 8. lsblk — список блочных устройств
  11. 9. df – дисковое пространство файловых систем
  12. 10. Pydf – команда df, написанная на языке Python
  13. 11. fdisk
  14. 12. mount
  15. 13. free – проверка оперативной памяти
  16. 14. dmidecode
  17. 15. Файлы /proc
  18. 16. hdparm
  19. Заключение
  20. 10 Commands to Collect System and Hardware Info in Linux
  21. 1. How to View Linux System Information
  22. 2. How to View Linux System Hardware Information
  23. 3. How to View Linux CPU Information
  24. 4. How to Collect Linux Block Device Information
  25. 5. How to Print USB Controllers Information
  26. 6. How to Print PCI Devices Information
  27. 7. How to Print SCSI Devices Information
  28. 8. How to Print Information about SATA Devices
  29. 9. How to Check Linux File System Information
  30. 10. How to Check Linux Hardware Components Info
  31. Summary
  32. If You Appreciate What We Do Here On TecMint, You Should Consider:
  33. How to Display Linux Hardware Info via Command Line
  34. 1. lshw
  35. 2. Inxi
  36. 3. hwinfo
  37. 4. lscpu
  38. 5. lsscsi
  39. 6. lsblk
  40. 7. lsusb
  41. 8. lspci
  42. 9. Using dmesg
  43. 10. Using dmidecode command
  44. 11. hdparm
  45. 12. From /proc file
  46. 13. free
  47. Conclusion

16 команд для проверки аппаратной части компьютера в Linux

Информация о комплектации компьютера

Точно также, как для всего прочего, в вашей системе Linux есть много команд для получения информацию об аппаратной части вашего компьютера. Некоторые команды сообщают информацию только о конкретных компонентах оборудования, например, процессоре или памяти, а другие — выдают информацию сразу о нескольких устройствах.

В данной статье кратко рассказывается о нескольких наиболее часто используемых командах, предназначенных для получения информации и особенностях настройки различных периферийных устройств и компонентах компьютера. Среди рассматриваемых — команды lscpu, hwinfo, lshw, dmidecode, lspci и другие.

1. lscpu

Команда lscpu выдает информацию о процессоре и его составляющих. В ней нет каких-либо дополнительных параметров или функциональных возможностей.

2. lshw – список аппаратных устройств

Утилита общего назначения, которая сообщает подробную и краткую информацию о нескольких различных аппаратных устройствах, таких как процессор, память, диск, контроллеры usb, сетевые адаптеры и т.д. Команда lscpu извлекает информацию из различных файлов /proc.

Если вы хотите больше узнать о команде lshw, то обратите внимание на пост Получаем интфомацию в Linux об аппаратных частях компьютера с помощью команды lshw .

3. hwinfo – информация об аппаратуре компьютера

Утилита hwinfo является еще одной универсальной утилитой зондирования аппаратуры, которая может сообщить подробную и краткую информацию о многих различных аппаратных компонентах, причем может сообщить больше, чем утилита lshw.

4. lspci – список устройств PCI

Команда lspci выдает список всех шин PCI, а также подробную информация об устройствах, которые к ним подключены. Под эту категорию подпадают следующие устройства — адаптер vga, графическая карта, сетевой адаптер, порты usb, контроллеры sata и т.д.

Отфильтруйте информацию о конкретном устройстве с помощью команды grep.

5. lsscsi — список устройств scsi

Выдается список устройств scsi/sata, например, жестких дисков и оптических приводов.

6. lsusb – подробный список шин и устройств usb

Эта команда показывает информацию о контроллерах usb и подробные сведения о подключенных к ним устройствах. По умолчанию выдается краткая информация. Для того, чтобы о каждом порте usb получить подробную информацию, используйте параметр «-v».

В системе, информация о которой приведена выше, один порт usb используется для подключения мыши.

7. Inxi

Inxi является мега скриптом bash, состоящим из 10000 строк кода, с помощью которого из разных источников и команд системы будет получена подробная информация об аппаратном обеспечении и будет создан отчет в виде, позволяющим его читать пользователям, которые не являются техническими специалистами.

8. lsblk — список блочных устройств

Перечисляется информация о всех блочных устройствах, которыми являются разделы жестких дисков и других устройств хранения данных, например, оптических приводов и флэш-накопителей

9. df – дисковое пространство файловых систем

Отчеты о различных разделах, об их точках монтирования и о том, сколько в каждом разделе есть свободного места.

10. Pydf – команда df, написанная на языке Python

Улучшенный вариант команды df , написанной на языке python, который выдает информацию в цвете, что выглядит лучше, чем информация, выдаваемая командой df

11. fdisk

Fdisk является утилитой, предназначенной для изменения разделов жестких дисков, и ей также можно пользоваться для получения информации о списке имеющихся разделов.

12. mount

Команда mount используется для монтирования/демонтирования, а также для просмотра смонтированных файловых систем.

Читайте также:  Как написать демона linux

Опять же, используйте команду grep для отфильтровывания информации только о тех файловых системах, которые вам интересны

13. free – проверка оперативной памяти

С помощью команды free проверьте объем используемой, свободной и общий объема оперативной памяти, имеющейся в системе.

14. dmidecode

Команда dmidecode отличается от всех других команд. Она извлекает информацию об оборудовании, читая для этого данные из структур данных SMBOIS (которые также называются таблицами DMI).

Подробности смотрите на странице man.

15. Файлы /proc

Во многих виртуальных файлах каталога /proc содержится информация об аппаратном обеспечении и о конфигурациях. Ниже приведены некоторые из них.

Информация о процессоре/памяти

Информация о Linux/ядре

16. hdparm

Команда hdparm получает информацию об устройствах sata, например, жестких дисков.

Заключение

В каждой из команд используется чуть-чуть иной способ извлечения информации, и вам для, чтобы получить определенную информацию об оборудовании, возможно, потребуется попробовать более одной команды. Но все они есть в большинстве дистрибутивов Linux и их легко можно установить из репозиториев, используемых по умолчанию.

Для тех, кто не хочет запоминать и вводить команды, на рабочем столе есть графические инструментальные средства. Hardinfo и I-nex — некоторые из популярных инструментальных средств, с помощью которых можно получить подробную информацию о большом количестве различных аппаратных компонентов.

Источник

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.

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.

Читайте также:  Linux network restart command

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.

Источник

How to Display Linux Hardware Info via Command Line

When a user works on a Linux system, in some cases, the user needs to know the information about the hardware under the operating system. This helps us to install compatible applications and utilities which adapt to hardware components of the system.

This tutorial will go through many utilities with detailed explanations of how to get the Linux hardware information.

1. lshw

The lshw stands for List Hardware. It collects the detailed information of the hardware on your system. lshw can show you the name of mainboard, CPU information, bus speed and firmware version and more.
In order to display the information of all the hardware components, run:

If you want to shorten the result, run the command with -short option:

You will receive the brief list of hardware components on your Linux system:

Display disk properties and storage device properties on Linux system by running:

You can get the brief result you may use the option -short :

This tool is also available in a GTK graphical version:

2. Inxi

Inxi is a powerful feature-rich command line tool for Linux users when they want to get the information of system hardware, CPU, RAM, Graphics card, drivers, battery, kernel, process information, and more.

By default, Inxi is not pre-installed on Linux. In order to use it, install the inxi package by running the following command:

Running inxi without any option:

The command will return the information of CPU and Memory as follows:

In order to get the graphics info, run the following command:

To show audio/sound card information, run:

To show battery data, charge, condition, plus extra information (if battery present), run the command with -B option:

3. hwinfo

The hwinfo command is a powerful tool for Linux users to get the detail of hardware components of system. It helps you collect almost of information about: CPU, USB controller, graphics controller, network devices and more.

You can use hwinfo command with —short and —devicetype options to list a specific type of information.
Display information about NIC cards and find out what eth0, eth1 stands for by running:

Читайте также:  Как работать с загрузочный диск windows

In order to display storage information with hwinfo command, run:

Likewise, to display list of partitions and hard disks, run the following command:

4. lscpu

The lscpu will show you all the information of your CPU such as number of CPUs, cores, threads, sockets and CPU family, caches, model and more.

You can get the detail of the CPU by running the following command:

The output of the command will be something likes this:

Moreover, if you want to view the speed of the CPU in MHz, run the command:

5. lsscsi

The lsscsi is used to list all of the SCSI (Small Computer System Interface) devices and NVMe (Non-Volatile Memory express) devices on your machine.

By default, the lsscsi is not pre-installed on Ubuntu, run the following command to install:

You can simply use the command by running:

6. lsblk

The lsblk command will show you the details of all the block devices in a tree format. It gathers information from sysfs filesystem and udev database.

In order to list all of block devices and their partitions and sizes, let’s run the following command:

7. lsusb

The lsusb is a powerful tool for displaying all the information about USB devices connected to USB buses of your Linux system. The information contains: speed, class, vendor id, product id, bus of USB devices etc.

You can run the following command to get brief information:

If you want to display the specified device with Bus and Device number, run the command with ‘-s’ option. For example:

8. lspci

This standard Linux utility shows what your systems have got internally. The command is a combination of ls, the standard command to list files and PCI that is for the peripheral connection. You can also expect your results to include AGP and onboard components like your USB chipset.

The command is much helpful in diagnosing bugs related to PCI devices. Using ‘-t’ option of lspci command you can see PCI layout in a tree format.

In order to get more detailed information, use -v option with -t option:

You can just run lspci command to display basic device information:

9. Using dmesg

The dmesg command is useful to find out some info about hardware events. It displays the contents of the system log.

The following command lists all references to universal serial bus devices:

In order to display the details about physical memory that is RAM, run:

10. Using dmidecode command

Dmidecode stands for Desktop Management Interface decode, it is a powerful tool for retrieving the information of CPU, RAM, serial numbers, BIOS. The command will show you the hardware details in a human-readable format.

In order to get the Information about BIOS, run:

If you want to display the hardware components information by ID, run the command with -t option following by a number ID (DMI).

For example, the following command will show you the information of memory Device:

11. hdparm

The hdparm stands for Hard Disk Parameter. It’s a Linux command line utility used for handling hard disk devices. You can also use hdparm command to set parameters such as power management, sleep mode, drive caches, Direct Memory Access settings, etc.

For instance, in order to display information of the hard disk, run the following command:

Another example, you can use hdparm to test the speed of hard disk by running the following command:

12. From /proc file

The /proc directory contains lots of system and hardware information. You can try the following commands to get more info on devices:

The output of the command will be something likes this:

In addition, you can run some other commands in order to get information about CPU, Memory, and PCI devices respectively.

13. free

Sometimes, you want to know whether the free memory (RAM) is enough to launch or install a new program? In this case, you can use free command to get information about memory detail in your Linux system.

The free command not only shows you information about the total amount of physical RAM and swap but also free and used memory. For example:

Conclusion

In this tutorial, we learned how to use Linux command line to get information about the hardware components of the system.

Thanks for reading and please leave your suggestion in the below comment section.

Источник

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