- 10 Commands to Collect System and Hardware Info in Linux
- 1. How to View Linux System Information
- 2. How to View Linux System Hardware Information
- 3. How to View Linux CPU Information
- 4. How to Collect Linux Block Device Information
- 5. How to Print USB Controllers Information
- 6. How to Print PCI Devices Information
- 7. How to Print SCSI Devices Information
- 8. How to Print Information about SATA Devices
- 9. How to Check Linux File System Information
- 10. How to Check Linux Hardware Components Info
- Summary
- If You Appreciate What We Do Here On TecMint, You Should Consider:
- 16 Commands to Check Hardware Information on Linux
- Hardware information
- 1. lscpu
- 2. lshw — List Hardware
- 3. hwinfo — Hardware Information
- 4. lspci — List PCI
- 5. lsscsi — List scsi devices
- 6. lsusb — List usb buses and device details
- 7. Inxi
- 8. lsblk — List block devices
- 9. df — disk space of file systems
- 10. Pydf — Python df
- 11. fdisk
- 12. mount
- 13. free — Check RAM
- 14. dmidecode
- 15. /proc files
- 16. hdparm
- Summary
- 48 thoughts on “ 16 Commands to Check Hardware Information on Linux ”
- Тест производительности Linux
- Что такое Phoronix Test Suite?
- Доступные тесты производительности
- Тесты общей производительности системы (System):
- Тесты производительности процессора (Processor):
- Тесты производительности памяти (Memory):
- Тесты производительности дисковой подсистемы (Disk):
- Тесты производительности видеокарты (Graphics):
- Тест производительности Linux
- 1. Установка Phoronix Test Suite
- 2. Подключение учётной записи
- 3. Просмотр доступных бенчмарков
- 4. Установка тестов
- 5. Запуск тестов
- 6. Просмотр результатов тестов
- 7. Работа с сайтом openbenchmarking.org
- 8. Настройка сетевого доступа для тестов
- 9. Сервер тестирования компьютеров в локальной сети
- Выводы
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.
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.
Источник
16 Commands to Check Hardware Information on Linux
Hardware information
Like for every thing, there are plenty of commands to check information about the hardware of your linux system.
Some commands report only specific hardware components like cpu or memory while the rest cover multiple hardware units.
This post takes a quick look at some of the most commonly used commands to check information and configuration details about various hardware peripherals and devices.
The list includes lscpu, hwinfo, lshw, dmidecode, lspci etc.
1. lscpu
The lscpu command reports information about the cpu and processing units. It does not have any further options or functionality.
2. lshw — List Hardware
A general purpose utility, that reports detailed and brief information about multiple different hardware units such as cpu, memory, disk, usb controllers, network adapters etc. Lshw extracts the information from different /proc files.
Check out the following post to learn more about lshw
3. hwinfo — Hardware Information
Hwinfo is another general purpose hardware probing utility that can report detailed and brief information about multiple different hardware components, and more than what lshw can report.
4. lspci — List PCI
The lspci command lists out all the pci buses and details about the devices connected to them.
The vga adapter, graphics card, network adapter, usb ports, sata controllers, etc all fall under this category.
Filter out specific device information with grep.
5. lsscsi — List scsi devices
Lists out the scsi/sata devices like hard drives and optical drives.
6. lsusb — List usb buses and device details
This command shows the USB controllers and details about devices connected to them. By default brief information is printed. Use the verbose option «-v» to print detailed information about each usb port
On the above system, 1 usb port is being used by the mouse.
7. Inxi
Inxi is a 10K line mega bash script that fetches hardware details from multiple different sources and commands on the system, and generates a beautiful looking report that non technical users can read easily.
8. lsblk — List block devices
List out information all block devices, which are the hard drive partitions and other storage devices like optical drives and flash drives
9. df — disk space of file systems
Reports various partitions, their mount points and the used and available space on each.
10. Pydf — Python df
An improved df version written in python, that displays colored output that looks better than df
11. fdisk
Fdisk is a utility to modify partitions on hard drives, and can be used to list out the partition information as well.
12. mount
The mount is used to mount/unmount and view mounted file systems.
Again, use grep to filter out only those file systems that you want to see
13. free — Check RAM
Check the amount of used, free and total amount of RAM on system with the free command.
14. dmidecode
The dmidecode command is different from all other commands. It extracts hardware information by reading data from the SMBOIS data structures (also called DMI tables).
Check out the man page for more details.
15. /proc files
Many of the virtual files in the /proc directory contain information about hardware and configurations. Here are some of them
16. hdparm
The hdparm command gets information about sata devices like hard disks.
Summary
Each of the command has a slightly different method of extracting information, and you may need to try more than one of them, while looking for specific hardware details. However they are available across most linux distros, and can be easily installed from the default repositories.
On the desktop there are gui tools, for those who do not want to memorise and type commands. Hardinfo, I-nex are some of the popular ones that provide detailed information about multiple different hardware components.
A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected] .
48 thoughts on “ 16 Commands to Check Hardware Information on Linux ”
How i can check memory in CPU. Example OPT, Efuse
Thanks for this. I’m just getting going on a VPS and this helped me discover they’d not given me the extra 1Gb I ordered. Very well explained.
Super happy with
inxi -Fx
more accurate than some of the other utilities.. for instance hwinfo was inaccurate for my Lenovo
Thanks for the great post!
Thank you! Your descriptions were useful and well explained!
Источник
Тест производительности Linux
Пользователи редко задумываются о конфигурации и производительности используемого ими персонального компьютера. Обычно интерес к этой теме возникает в том случае, если пользователь увлечён сферой информационных технологий или если его не устраивает текущая производительность системы.
Однако, этот вопрос весьма важен, особенно если рабочая станция — ваше устройство, используемое для развлечений, отдыха и работы. В этой статье мы разберемся как выполнить тест производительности Linux и рассмотрим один из инструментов тестирования производительности — Phoronix Test Suite.
Что такое Phoronix Test Suite?
Данный пакет — открытое программное обеспечение, используемое для автоматического тестирования комплектующих системы с помощью огромного набора бенчмарков. С данным ПО тесно связан сайт openbenchmarking.org, позволяющий сохранять и вести свою базу результатов тестов, а также делиться своими достижениями с другими.
С помощью Phoronix Test Suite вы можете найти узкое место в своей конфигурации компьютера, сравнить вашу систему с аналогичными системами других пользователей, оценить общую производительность или производительность конкретных узлов ПК. Для всех этих целей пакет предлагает широкий выбор тестов, разделённый на несколько категорий:
- System — тесты общей производительности системы.
- Processor — тесты производительности процессора.
- Memory — тесты производительности оперативной памяти.
- Graphics — тестирование производительности видеокарты.
- Disk — тесты производительности дисковой подсистемы.
Рассмотрим каждую категорию отдельно, составив список интересных бенчмарков.
Доступные тесты производительности
Тесты общей производительности системы (System):
- PyBench — тест, вызывающий различные функции, реализованные с использованием Python. Позволяет оценить общую производительность системы Linux.
- Blender — тест на основе программного обеспечения с открытым исходным кодом для создания 3D-сцен и 3D-моделей.
- BRL-CAD — бенчмарк на базе кросс-платформенного программного обеспечения для твердотельного моделирования.
- IndigoBench — тест на основе Indigo Renderer (фотореалистичного рендера для GPU и CPU, применяющего методики точного моделирования физики света).
- LuxMark — мультиплатформенный тест OpenGL, основанный на LuxRender. Использует библиотеку OpenCL, содержит несколько различных сцен для рендеринга. LuxRender — система рендеринга для Blender и 3DS Max.
- Ethminer — бенчмарк на основе Ethereum Ethminer (Майнер GPU для различных монет, основанных на алгоритме Ethash).
- V-Ray — бенчмарк на основе рендера V-Ray от Chaos Group.
Тесты производительности процессора (Processor):
- Build-GCC — тест процессора linux, показывающий сколько времени занимает сборка коллекции GNU Compiler Collection. Содержит библиотеки, написанные на следующих языках: C, C++, Objective-C, Fortran, Ada, Go и D.
- Build-PHP — тест даёт оценку быстроте компиляции PHP7.
- Go-benchmark — бенчмарк, вычисляющий производительность процессора в Go для HTTP, JSON и сборки мусора.
- Dacapobench — тесты DaCapo, написанные на Java и тестирующие производительность процессора.
- SciMark2 — бенчмарк SciMark 2.0, оценивающий производительность научных и целочисленных вычислений и разработанный программистами National Institute of Standards and Technology. Содержит несколько подтестов, основанных на различных алгоритмах.
- FFmpeg — тест на основе набора библиотек FFmpeg, позволяющих кодировать/декодировать аудиозаписи и видеозаписи в различные форматы. Тестирует производительность кодирования аудио/видео системой.
- LuxCoreRender — рендер с открытым исходным кодом. Данный бенчмарк оценивает производительность процессора.
- X264 — тест производительности процессора Linux при кодировании x264-видео.
- Povray — бенчмарк на основе программы The Persistence of Vision Raytracer, строящий 3D-сцены на основе трассировки лучей.
- OpenSSL — тест процессора, измеряющий производительность процессора при использовании алгоритма шифрования RSA, 4096-бит, OpenSSL.
Тесты производительности памяти (Memory):
- RAMspeed — тест памяти Linux, измеряющий производительность оперативной памяти.
- SQLite — тест оперативной памяти, измеряющий время, необходимое для выполнения вставки данных в индексированную базу данных.
Тесты производительности дисковой подсистемы (Disk):
- Iozone — тестирует производительность жёсткого диска linux, а также файловой системы.
Тесты производительности видеокарты (Graphics):
- UNIGINE-Heaven — бенчмарк, вычисляющий среднюю частоту кадров в демо UNIGINE Heaven. Данное демо было выпущено в 2009 году.
- UNIGINE-Valley — тест видеокарты linux, вычисляющий среднюю частоту кадров в демо UNIGINE Valley. Исходное ПО было выпущено в 2013 году и использует OpenGL 3.
- UNIGINE-Superposition — тест видеокарты на основе демо UNIGINE Superposition, вышедшего в 2017 году. Исходный тест содержит режим для виртуальной реальности.
- UE4-Atlantis — тест на основе демо на движке Unreal Engine 4. Тест вышел в 2015 году.
Тест производительности Linux
1. Установка Phoronix Test Suite
В репозиториях операционных систем семейства Linux обычно содержится устаревшая версия пакета. Поэтому, в первую очередь скачиваем свежую версию дистрибутива по адресу: https://www.phoronix-test-suite.com/?k=downloads.
Далее предлагаем последовательность установки для операционной системы Ubuntu.
Открываем командный интерпретатор bash и выполняем следующие команды:
sudo apt install gdebi-core
Пакет, позволяющий устанавливать программное обеспечение из пакетов *.deb, установлен. Затем устанавливаем скачанную нами версию тестового программного обеспечения:
sudo gdebi phoronix-test-suite_9.4.0_all.deb
Данную команду надо выполнять из папки, в которой находится скачанный дистрибутив Phoronix Test Suite.
2. Подключение учётной записи
Далее рекомендуем вам на сайте openbenchmarking.org, сохраняющем результаты тестов с использованием Phoronix Test Suite, создать свою учётную запись. После этого подключаем вашу учётную запись с помощью команды:
Вводим свой логин и пароль.
На этом установка Phoronix Test Suite завершена.
3. Просмотр доступных бенчмарков
Посмотреть доступные бенчмарки можно с помощью команды:
sudo phoronix-test-suite list-all-tests
Просмотреть установленные тесты можно с помощью команды:
sudo phoronix-test-suite list-installed-tests
Просмотреть неустановленные тесты можно с помощью команды:
sudo phoronix-test-suite list-not-installed-tests
4. Установка тестов
Устанавливаются нужные вам тесты с помощью команды:
sudo phoronix-test-suite install [ имя теста ]
sudo phoronix-test-suite install build-gcc
В случае некорректной установки выбранного бенчмарка можно использовать для удаления теста команду:
sudo phoronix-test-suite remove-installed-test [ имя теста ]
sudo phoronix-test-suite remove-installed-test build-gcc
Для того, чтобы выявить ошибки в процессе установки, необходимо воспользоваться командой:
sudo ph oronix-test-suite debug-install [ имя теста ]
sudo phoronix-test-suite debug-install build-gcc
5. Запуск тестов
Запуск чтобы запустить конкретный тест производительности linux из состава пакета выполните:
sudo phoronix-test-suite run [ имя теста ]
sudo phoronix-test-suite run pybench
После запуска Phoronix Test Suite спрашивает, сохранить результаты или нет. Выбираем Y. В следующем запросе нужно ввести имя файла результатов теста, например, test-28-02-2020-01. Затем тест запрашивает уникальное имя теста (конфигурации теста). Последним запрашивается описание тестовой конфигурации (можно оставить по умолчанию).
После выполнения теста выводится предложение просмотреть результат в браузере и загрузить результат на сайт openbenchmarking.org.
Результат в браузере выглядит следующим образом
Запуск нескольких тестов одновременно производится командой:
sudo phoronix-test-suite run [ имя теста ] [ имя теста ] [ имя теста ] … [ имя теста ]
sudo phoronix-test-suite run scimark2 pybench
Запуск теста с отслеживанием ошибок производится командой:
sudo phoronix-test-suite debug-run [ имя теста ]
sudo phoronix-test-suite debug-run scimark2
6. Просмотр результатов тестов
Отобразить на экране список сохранённых результатов тестов Linux можно с помощью команды:
sudo phoronix-test-suite list-saved-results
Просмотреть конкретный результат можно с помощью команды:
sudo phoronix-test-suite show-result [ saved name ]
sudo phoronix-test-suite show-result 2002279-FIRE-TEST26009
Удалить результат можно с помощью команды:
sudo phoronix-test-suite remove-result [ saved name ]
sudo phoronix-test-suite remove-result 2002279-FIRE-TEST26009
Переименовать файл, содержащий результаты, можно следующей командой:
sudo phoronix-test-suite rename-result-file [ saved name ]
sudo phoronix-test-suite rename-result-file test-26-02-2020-02
Команда запрашивает новое имя файла:
Сохранить результаты в формате pdf можно с помощью команды:
sudo phoronix-test-suite result-file-to-pdf [ saved name ]
sudo phoronix-test-suite result-file-to-pdf test-28-02-2020-01
Объединить результаты из разных файлов в один можно с помощью команды:
sudo phoronix-test-suite merge-results [ saved name ] [ saved name ] … [ saved name ]
sudo phoronix-test-suite merge-results test-26-02-2020-02 test-28-02-2020-01
При этом имя для объединённого результата программа выбирает сама, отдельные старые результаты тоже сохраняются.
Внимание! При выполнении этой команды ссылка для просмотра результата в браузере у меня получалась нерабочей, но в дальнейшем результат было можно просмотреть с помощью команды
sudo phoronix-test-suite show-result [ saved name ].
7. Работа с сайтом openbenchmarking.org
Вставка результата в базу сайта производится следующим образом:
sudo phoronix-test-suite upload-result [ saved name ]
sudo phoronix-test-suite upload-result test-28-02-2020-01
Загрузить конкретный результат текущего пользователя с сайта на ПК можно с помощью команды:
sudo phoronix-test-suite clone-result [ OpenBenchmarking ID test ]
sudo phoronix-test-suite clone-result 2002279-FIRE-TEST26009
Посмотреть загруженные с данного IP на сайт результаты тестов можно с помощью команды:
sudo phoronix-test-suite openbenchmarking-uploads
Также посмотреть результаты тестов можно непосредственно в браузере на сайте openbenchmarking.org.
Для того, чтобы сформировать выборку тестов, необходимо установить флажки с названием файлов результатов и нажать на ссылку Compare Selected Results.
Результат сформированной выборки будет выглядеть так:
8. Настройка сетевого доступа для тестов
Следующая команда показывает параметры сетевых настроек для пакета:
sudo phoronix-test-suite network-info
Настроить параметры прокси-сервера для доступа к базам тестов в Интернет можно с помощью команды:
sudo phoronix-test-suite network-setup
9. Сервер тестирования компьютеров в локальной сети
Кроме того, пакет Phoronix Test Suite содержит сервер удалённого тестирования Phoromatic, с помощью которого можно организовать централизованное тестирование и хранение результатов тестов в локальной сети. Подробное рассмотрение данного сервера выходит за рамки нашей статьи.
Выводы
В статье мы рассмотрели как оценить производительность Linux и как пользоваться Phoronix Test Suite. Этот пакет содержит огромный выбор тестов на любой вкус. Нами порекомендованы некоторые из них для всестороннего тестирования персонального компьютера. Также были рассмотрены особенности работы с программой в командной оболочке. Было уделено внимание выгрузке результатов на сайт, комбинированию и просмотру результатов.
Теперь вы тоже можете присоединиться к сообществу тестеров Phoronix Test Suite. Делитесь своими результатами тестов в комментариях!
Источник