Меню Рубрики

Cpu current speed linux

What is the correct way to view your CPU speed on Linux?

I found two commands to output information about my CPU: cat /proc/cpuinfo and lscpu . /proc/cpuinfo shows that my CPU speed is 2.1 Ghz, whereas lspcu says it is 3167 Mhz. Which one is correct?

This is my exact output from cat /proc/cpuinfo about my processor speed:

And this is from lscpu :

(For some reason, lscpu outputs differently every time, varying between 3100 and 3300 MHz)

6 Answers 6

To see the current speed of each core I do this:

Note:

If your watch command does not work with intervals smaller than one second, modify the interval like so:

This displays the cpu speed of each core in real time.

By running the following command, one or more times, from another terminal one can see the speed change with the above watch command, assuming SpeedStep is enabled ( Cool’n’Quiet for AMD ).

(This command uses bc to calculate pi to 10000 places.)

For intel i3, i5 and i7 based cpus there is a dedicated tool called i7z that shows current speed for all cpu cores.

From man page (description):

i7z runs the i7z, ncurses based, program without any options. i7z will print out the C-states and temperature for i3, i5 and i7 based Core processors from Intel (including Nehalems, Sandy Bridge and Ivy Bridge).

For ubuntu-based distributions you can install it by issuing this command:

then just run it (tool needs to be run with sudo):

The Intel Core i7-4600U Processor supports Turbo Boost technology. It has a base frequency of 2.10GHz and a Max Turbo Frequency of 3.30GHz. That means that,

  • If you disable the Turbo Boost (in the BIOS setup menu), the CPU will work at 2.10GHz all the time.
  • When Turbo Boost is enabled and only one of the cores is working, the CPU will work at a maximum of 3.30GHz.
  • If Turbo Boost is enabled and all the cores are working, the CPU will work at 2.10GHz.

Obtaining current frequency

To determine if the Turbo Boost is activated and which is the current frequency, you can use cpupower frequency-info . For instance, for an old Intel Core i5-660 with Turbo Boost enabled, you will get the following.

Note that the information states the hardware limits ( 1.20 GHz — 3.47 GHz ), the possible frequencies ( 3.47 GHz, 3.33 GHz, 2.53 GHz, 1.87 GHz, 1.20 GHz ) and the current frequency ( 1.87 GHz ). You may find the technical information of these frequencies at the Intel website.

Frequency when TurboBoost is disabled

Note the difference when you run the same command with Turbo Boost disabled: In the boost state support section, the values for Supported and Active are no . Here, the CPU will be at the nominal/minimal value (1.20Ghz) all the time.

You can disable the Turbo Boost using the BIOS or some Linux options/commands. The kernel support can be enabled/disabled using the /sys/devices/system/cpu/cpufreq/boost file.

Источник

Any way to check the clock speed of my processor?

Is there any way to check at which clock speed my processor is running?

I have already tried cat /proc/cpuinfo but the clock speed I’m running isn’t showing. I know Ubuntu 12.04 (Precise Pangolin) requires 700 MHz and VGA, but will an AMD Mobile Sempron work?

17 Answers 17

From the command line type lscpu . The information will be at CPU MHz:

There are a couple of ways:

lscpu or more precise lscpu | grep «MHz» .
This will give you the general MHz for the CPU.

cat /proc/cpuinfo or more precise cat /proc/cpuinfo | grep «MHz» .
This will give you the individual MHz for each CPU Core. So if you have an Core 2 Duo, AMD Bulldozer, Core i7, etc.. it will show the MHz for each core.

lshw -c cpu or more precise version: lshw -c cpu | grep capacity
Will give you the general MHz. Same as lscpu .

sudo dmidecode -t processor or more precise: sudo dmidecode -t processor | grep «Speed» Will not only give you a MHz in use but also the Maximum you can push / overclock your CPU to.

Out of all of this, lshw and dmidecode provide the best information out of your CPU.

You can also target the current MHz detected by the kernel by querying the log files:

cat /var/log/dmesg | grep «MHz processor» — For the current detected MHz speed

cat /var/log/kern.log | grep «MHz processor» — For the current and past detected MHz speeds. Will not work in some cases, that is why I posted the dmesg one first.

And that’s all I can remember from the top of my head. I am fairly certain there are other ways, just don’t remember right now. Of course, talking about terminal ways.

Источник

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.

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

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

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.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

  • God of war mac os
  • Gnome 3 mac os style
  • Git для mac os
  • Git mac os установка
  • Git mac os основы