Linux get cpu name

9 команд для проверки информации о CPU в Linux

Информация об аппаратном обеспечении CPU

Информация о CPU (Central Processing Unit. Центральный процессор) включает в себя подробные сведения о процессоре, такие как архитектура, название производителя, модель, количество ядер, скорость каждого ядра и т.д.

В linux существует довольно много команд для получения подробной информации о CPU.

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

1. /proc/cpuinfo

Файл /proc/cpuinfo содержит подробную информацию об отдельных ядрах CPU.

Выведите его содержимое с помощью less или cat .

Каждый процессор или ядро перечислены отдельно, а различные подробности о скорости, размере кэша и названии модели включены в описание.

Чтобы подсчитать количество процессоров, используйте grep с wc

Количество процессоров, показанное в /proc/cpuinfo, может не соответствовать реальному количеству ядер процессора. Например, процессор с 2 ядрами и гиперпоточностью будет показан как процессор с 4 ядрами.

Чтобы получить фактическое количество ядер, проверьте идентификатор ядра на наличие уникальных значений

Соответственно, есть 4 разных идентификатора ядра. Это указывает на то, что существует 4 реальных ядра.

2. lscpu — отображение информации об архитектуре CPU

lscpu — это небольшая и быстрая команда, не требующая никаких опций. Она просто выводит информацию об аппаратном обеспечении CPU в удобном для пользователя формате.

3. hardinfo

Hardinfo — это gui инструмент на базе gtk, который генерирует отчеты о различных аппаратных компонентах. Но он также может запускаться из командной строки, в случае если отсутствует возможность отображения gui (Graphical User Interface — графический интерфейс пользователя).

Он создаст большой отчет о многих аппаратных частях, читая файлы из каталога /proc. Информация о CPU находится в начале отчета. Отчет также может быть записан в текстовый файл.

Hardinfo выполняет несколько эталонных тестов, занимающих несколько минут, прежде чем вывести отчет на экран.

4. lshw

Команда lshw может отобразить ограниченную информацию о CPU. lshw по умолчанию показывает информацию о различных аппаратных частях, а опция ‘ -class ‘ может быть использована для сбора информации о конкретной аппаратной части.

Производитель, модель и скорость процессора отображаются правильно. Однако из приведенного выше результата невозможно определить количество ядер в процессоре.

Чтобы узнать больше о команде lshw, ознакомьтесь с этой статьей:

5. nproc

Команда nproc просто выводит количество доступных вычислительных блоков. Обратите внимание, что количество вычислительных блоков не всегда совпадает с количеством ядер.

6. dmidecode

Команда dmidecode отображает некоторую информацию о CPU, которая включает в себя тип сокета, наименование производителя и различные флаги.

7. cpuid

Команда cpuid собирает информацию CPUID о процессорах Intel и AMD x86.

Программа может быть установлена с помощью apt на ubuntu

А вот пример вывода

8. inxi

Inxi — это скрипт, который использует другие программы для создания хорошо структурированного легко читаемого отчета о различных аппаратных компонентах системы. Ознакомьтесь с полным руководством по inxi.

Вывод соответствующей информации о CPU/процессоре

Чтобы узнать больше о команде inxi и ее использовании, ознакомьтесь с этой статьей:

9. Hwinfo

Команда hwinfo — это программа для получения информации об оборудовании, которая может быть использована для сбора подробных сведений о различных аппаратных компонентах в системе Linux.

Она также отображает информацию о процессоре. Вот быстрый пример:

Если не использовать опцию «—short», команда отобразит гораздо больше информации о каждом ядре CPU, например, архитектуру и характеристики процессора.

Чтобы более подробно изучить команду hwinfo, ознакомьтесь с этой статьей:

Заключение

Это были некоторые команды для проверки информации о CPU в системах на базе Linux, таких как Ubuntu, Fedora, Debian, CentOS и др.

Читайте также:  Как запустить службу шифрования windows

Примеры других команд для проверки информации о CPU смотрите в этой статье:

Большинство команд обрабатываются с помощью интерфейса командной строки и выводятся в текстовом формате. Для GUI интерфейса используйте программу Hardinfo.

Она показывает подробности об аппаратном обеспечении различных компонентов в простом для использования GUI интерфейсе.

Если вы знаете какую-либо другую полезную команду, которая может отображать информацию о CPU, сообщите нам об этом в комментариях ниже

Если вы хотели бы узнать подробнее о формате обучения и программе, познакомиться с преподавателем курса — приглашаем на день открытых дверей онлайн. Регистрация здесь.

А если вам интересно развитие в этой сфере с нуля до pro, рекомендуем ознакомиться с учебной программой специализации.

Источник

9 Useful Commands to Get CPU Information on Linux

In a previous article, we put together a list of 10 useful commands to collect system and hardware information in Linux. In this guide, we will narrow down to the CPU/processor, and show you various ways of extracting detailed information about your machine CPU.

Just to give you an overview, we will query information such as CPU architecture, vendor_id, model, model name, number of CPU cores, speed of each core, and lots more.
Essentially, the /proc/cpuinfo contains this all info, every other command/utility gets its output from this file.

With that said, below are 9 commands for getting info about your Linux CPU.

1. Get CPU Info Using cat Command

You can simply view the information of your system CPU by viewing the contents of the /proc/cpuinfo file with the help of cat command as follows:

To get a little specific, you can employ the grep command – a CLI tool for searching plain-text data for lines matching a regular expression. This can help you only output vendor name, model name, number of processors, number of cores, etc:

2. lscpu Command – Shows CPU Architecture Info

The command lscpu prints CPU architecture information from sysfs and /proc/cpuinfo as shown below:

3. cpuid Command – Shows x86 CPU

The command cpuid dumps complete information about the CPU(s) collected from the CPUID instruction, and also discover the exact model of x86 CPU(s) from that information.

Make sure to install it before running it.

Once installed, run cpuid to collect information concerning the x86 CPU.

4. dmidecode Command – Shows Linux Hardware Info

dmidecode is a tool for retrieving hardware information of any Linux system. It dumps a computer’s DMI (a.k.a SMBIOS) table contents in a human-readable format for easy retrieval. The SMBIOS specification defines various DMI types, for CPU, use “processor” as follows:

5. Inxi Tool – Shows Linux System Information

Inxi is a powerful command-line system information script intended for both console and IRC (Internet Relay Chat). You can use it to instantly retrieve hardware information.

You can install like so:

To display complete CPU information, including per CPU clock-speed and CPU max speed (if available), use the -C flag as follows:

6. lshw Tool – List Hardware Configuration

lshw is a minimal tool for gathering in-depth information on the hardware configuration of a computer. You can use the -C option to select the hardware class, CPU in this case:

7. hardinfo – Shows Hardware Info in GTK+ Window

hardinfo displays hardware information in a GTK+ window, you can install it as follows:

Once you have it installed, type:

Linux System Information

It also enables you to generate a system hardware info report by clicking on the “Generate Report” button. From the interface below, click on “Generate” to proceed. Note that you can choose the hardware info category to be generated.

Generate System Information Report

Once you have generated the report in html format, you can view it from a web browser as shown below.

Linux System Detailed Information

8. hwinfo – Shows Present Hardware Info

hwinfo is used to extract info about the hardware present in a Linux system. To display info about your CPU, use the —cpu

9. nproc – Print Number of Processing Units

nproc command is used to show the number of processing unit present on your computer:

For additional usage info and options, read through the man pages of these commands like this:

Читайте также:  Установка firefox для линукс

That’s it for now! You can share with us additional ways of extracting CPU information in Linux via the feedback form below.

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.

Источник

Получить информацию о процессоре в Linux

ЦП (центральный процессор), часто называемый просто процессором, является одним из основных компонентов вашего компьютера. Он выполняет все типы операций обработки данных, и его часто называют мозгом компьютера.

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

Получить информацию о процессоре в Linux

Самый простой способ определить, какой у вас тип ЦП, — просмотреть содержимое виртуального файла /proc/cpuinfo .

Определение типа процессора с помощью файла proc/cpuinfo не требует установки дополнительных программ. Он будет работать независимо от того, какой дистрибутив Linux вы используете.

Откройте свой терминал и используйте less или cat для отображения содержимого /proc/cpuinfo :

Команда напечатает каждый логический ЦП с идентификационным номером. Например, если у вас 8-ядерный процессор, вы увидите список всех ядер, начиная с 0 до 7. Ниже приведен пример вывода:

Ниже приведены пояснения к наиболее интересным строчкам:

  • процессор — уникальный идентификационный номер каждого процессора, начиная с 0.
  • название модели — полное название процессора, включая марку процессора. После того, как вы точно узнаете, какой у вас тип ЦП, вы можете проверить в документации по продукту технические характеристики вашего процессора.
  • flags — особенности процессора. Вы можете найти список всех функций здесь .

Если вы хотите отфильтровать вывод, вы можете использовать команду grep . Например, чтобы отобразить только имя процессора, вы должны использовать:

Чтобы распечатать количество процессоров:

Знание количества процессоров может быть полезно, когда вам нужно скомпилировать программное обеспечение из источника, и вы хотите знать, сколько параллельных процессов может выполняться одновременно. Другой способ узнать количество процессоров — использовать команду nproc :

Проверьте информацию о процессоре с помощью lscpu

lscpu — это утилита командной строки, которая отображает информацию об архитектуре ЦП. lscpu является частью пакета util-linux, который установлен во всех дистрибутивах Linux.

В приглашении оболочки введите lscpu :

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

В отличие от содержимого файла /proc/cpuinfo , вывод lscpu не показывает список всех логических процессоров.

Выводы

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

Не стесняйтесь оставлять комментарии, если у вас есть вопросы.

Источник

9 Commands to Check CPU Information on Linux

CPU hardware information

The cpu information includes details about the processor, like the architecture, vendor name, model, number of cores, speed of each core etc.

There are quite a few commands on linux to get those details about the cpu.

In this post we shall take a look at some of the commonly used commands that can be used to get details about the cpu.

1. /proc/cpuinfo

The /proc/cpuinfo file contains details about individual cpu cores.
Output its contents with less or cat.

Every processor or core is listed separately the various details about speed, cache size and model name are included in the description.

To count the number of processing units use grep with wc

To get the actual number of cores, check the core id for unique values

So there are 4 different core ids. This indicates that there are 4 actual cores.

2. lscpu — display information about the CPU architecture

lscpu is a small and quick command that does not need any options. It would simply print the cpu hardware details in a user-friendly format.

Читайте также:  Windows 10 pro iso активированная

3. hardinfo

Hardinfo is a gtk based gui tool that generates reports about various hardware components. But it can also run from the command line only if there is no gui display available.

It would produce a large report about many hardware parts, by reading files from the /proc directory. The cpu information is towards the beginning of the report. The report can also be written to a text file.

Hardinfo also performs a few benchmark tests taking a few minutes before the report is displayed.

4. lshw

The lshw command can display limited information about the cpu. lshw by default shows information about various hardware parts, and the ‘-class’ option can be used to pickup information about a specific hardware part.

The vendor, model and speed of the processor are being shown correctly. However it is not possible to deduce the number of cores on the processor from the above output.

5. nproc

The nproc command just prints out the number of processing units available. Note that the number of processing units might not always be the same as number of cores.

6. dmidecode

The dmidecode command displays some information about the cpu, which includes the socket type, vendor name and various flags.

7. cpuid

The cpuid command fetches CPUID information about Intel and AMD x86 processors.

The program can be installed with apt on ubuntu

And here is sample output

8. inxi

Inxi is a script that uses other programs to generate a well structured easy to read report about various hardware components on the system. Check out the full tutorial on inxi.

Print out cpu/processor related information

To learn more about the inxi command and its usage check out this post:
Inxi is an amazing tool to check hardware information on Linux

9. Hwinfo

The hwinfo command is a hardware information program that can be used to collect details about various hardware components on a Linux system.

It also displays information about the processor. Here is a quick example:

If you don’t use the «—short» option it will display much more information about each cpu core like architecture and processor features.

To learn more about the hwinfo command check this post:
Check hardware information on Linux with hwinfo command

Conclusion

Those were some of the commands to check CPU information on Linux based systems like Ubuntu, Fedora, Debian, CentOS etc.

For some more command examples on checking cpu information check this post:
How to Check Processor and CPU Details on Linux — Command Examples

Most of the commands are command line based and show text output. For a GUI interface use the program called Hardinfo.

It shows hardware details about various components in a easy to use GUI interface.

If you know of any other useful command that can display information about the CPU, let us know in the comments below.

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] .

15 thoughts on “ 9 Commands to Check CPU Information on Linux ”

Very nicely explained. I highly recommend it in my articles. thank you.

Thank you for the information, i learn lot in this article. 🙂

Thanks for the Information.

Hi everybody, someone know how to get same information regarding the hardware where I installed a phisical linux ?

Thank you for sharing, it helping lot.

lshw now (DISTRIB_DESCRIPTION=”Linux Mint 17.3 Rosa”) includes a line like below at the bottom of it’s listing:

configuration: cores=4 enabledcores=4 threads=8

How to get the number of real cores, not HiperThreading.

For example, for i7, real cores are 4, but logical are 8. There is some way without root ?

check this post for commands to check the number of real cores.
https://www.binarytides.com/linux-check-processor/

are we still catting into grep?

grep ‘core id’ /proc/cpuinfo

yo Silver Moon, nice write-up bro. absolutelly useful stuff there, though the number of CPUs can be fetched using just ‘grep -c processor /proc/cpuinfo’. take care 🙂

Thank you for the helpful information. You can not look for “unique values” with the “cat /proc/cpuinfo |grep ‘core id’” command on a multiprocessor system. The situation gets even worse with hyperthreading enabled CPU’s.

Источник

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