How to Check CPU Frequency Linux? [8 Easy Ways]

Written by

Reviewed by

Last updated: July 12, 2024

Expert verified

SVG Image

TL;DR

To check CPU frequency Linux, try these methods:

  1. lscpu Command: Use the lscpu -e=CPU,MHZ command in your terminal to quickly view your CPU’s clock speed along with a detailed overview of the CPU architecture and core count.
  2. cpufreq-info Command: After installing cpufrequtils, run the cpufreq-info command to access detailed CPU frequency information, including current speed, scaling governors, and available frequency ranges, helping you optimize CPU performance.
  3. /proc File System: Simply type cat /proc/cpuinfo in your terminal to get a direct readout of your CPU speed from the virtual /proc file system, providing a straightforward approach without extra tools.

Explore the article below to learn how to check CPU speed and common errors that can occur while checking the clock speed.

If your Linux system feels slow, checking your CPU frequency can help. In this post, I’ll show you how to find out your CPU speed, optimize performance, and troubleshoot issues. You’ll get step-by-step instructions for eight different methods and tips on addressing common errors. By the end, you’ll have the knowledge to keep your system running smoothly and efficiently. Whether you’re a beginner or an experienced user, this guide will help you get the most out of your Linux setup.

Linux Get CPU Frequency: Why Is It Necessary?

Understanding your CPU speed in Linux is key to optimizing system performance, troubleshooting issues, and ensuring your setup meets necessary software requirements. Here’s why regularly checking your CPU speed is crucial for maintaining and enhancing the efficiency of your Linux environment:

  • Performance Optimization: Knowing the CPU speed helps in assessing whether a system meets the software requirements for optimal performance. It helps users and system administrators decide if a CPU upgrade is necessary or if they need to adjust software settings for better performance.
  • System Troubleshooting: CPU speed can be a crucial factor when diagnosing issues related to system slowdowns or when performance is not meeting expectations. By checking the CPU speed, users can determine if the CPU is throttling under heavy loads or overheating, which may cause it to underperform.
  • System Monitoring: Regularly checking the CPU speed allows for ongoing monitoring of the system’s health and performance. It’s especially useful in server environments and critical systems where maintaining a certain performance level is mandatory.
  • Benchmarking: For those involved in system testing and benchmarking, knowing the CPU speed is essential to establish baselines and compare the performance of different hardware setups. This information is vital for performance tuning and making informed decisions about hardware purchases.
  • Configuration and Compatibility: When installing new software or upgrades, it’s important to know the CPU speed to ensure compatibility and that the system specifications match the software requirements. This helps avoid installing software that is too resource-intensive for the current hardware.

How to Check CPU Frequency Linux?

To check CPU frequency on Linux, open your terminal and use the command lscpu to view a summary of your CPU architecture including the frequency. For more detailed frequency data, enter cat /proc/cpuinfo which shows the speed of each CPU core. Alternatively, install and use cpufreq-info to get comprehensive frequency statistics and scaling information. 

Here is the step-by-step guide for eight different methods to check CPU frequency Linux:

1. lscpu Command

The lscpu command is a popular and versatile method used to gather detailed information about the CPU, including clock speed. It provides a comprehensive overview of the CPU architecture, core count, and clock speed, allowing users to assess their system’s performance and compatibility with various software. Here are the steps to do it:

  1. Open the Terminal on your Linux system.
opening-terminal
  1. Type the following command: 
lscpu -e=CPU,MHZ
  1. It displays the clock speed of your CPU in megahertz (MHz).
displaying-clock-speed-in-MHz

2. cpufreq-info Command

The cpufreq-info command is specifically designed to retrieve CPU frequency-related information. It not only displays the current CPU clock speed on Linux but also provides details about available CPU frequency scaling governors and available clock frequencies. This method allows users to analyze and manage CPU performance, optimize power consumption, and maximize efficiency based on their specific requirements. Follow these steps:

  1. Access the Terminal window and install cpufrequtils package if not already installed. To install it on Ubuntu, you can use the command: 
sudo apt-get install cpufrequtils
  1. The output will be:
installing-cpufrequtils-package
  1. Once installed, type the following command: 
cpufreq-info
  1. The output will provide you with various information, including the current CPU clock speed, maximum clock speed, and more.
checking-cpu-clock-speed

3. /proc File System

The /proc file system is a virtual file system in Linux that provides information about various system resources. This method offers a simple and direct way to check the CPU clock speed, allowing you to obtain the information you need without the need for additional tools or applications. Here are steps to do it:

  1. Launch the command window and type the following command: 
cat /proc/cpuinfo
  1. The output will display the CPU speed in MHz.
check-cpu-clock-speed-on-linux-in-MHz

4. CPU-X Utility

CPU-X is a powerful and user-friendly utility that provides extensive information about the CPU, including clock speed, core count, cache details, and more. It offers an intuitive graphical interface, making it easy to understand and monitor CPU parameters. Here are the steps to do it:

  1. Open a Terminal and run the following command to install CPU-X on Ubuntu or Debian-based systems:
sudo apt install cpu-x
  1. The command will install CPU-X on Ubuntu.
installing-cpu-x-on-ubuntu
  1. Once the installation is complete, launch CPU-X from the application menu.
launching-CPU-X
  1. CPU-X will display detailed information about your CPU. Look for the Clocks section, which provides information about the current CPU speed. 
displaying-clock-speed-of-cpu

5. GNOME System Monitor

The GNOME System Monitor is a graphical utility that provides a comprehensive overview of system resources.This method offers a visually appealing and user-friendly interface to monitor the CPU speed, making it convenient to keep track of system performance and identify any fluctuations or abnormalities. Follow these steps:

  1. Open the Applications menu and search for System Monitor. Click on the System Monitor application to launch it.
launching-system-monitor
  1. In GNOME System Monitor, click on the Resources tab at the top of the window. Under the Resources tab, you’ll find various system resource information. Look for the CPU History section, which displays a real-time graph of CPU usage.
viewing-cpu-clock-speed-through-GUI

6. Using hwinfo

hwinfo is a versatile tool that provides exhaustive hardware information, including CPU speed. It’s particularly useful for users who need a comprehensive overview of their system’s hardware capabilities.

  1. Open your Terminal and to install hwinfo, run the command:
sudo apt install hwinfo

This command installs the hwinfo package from the repository.

installing hwinfo on ubuntu 1
  1. To extract detailed information about your CPU, including the speed, enter: 
hwinfo --cpu

This command displays extensive CPU details, including model, architecture, and speed.

extracting info about cpu
  1. Look for lines that specify CPU clock speed to find the current CPU speed. hwinfo also provides details on capabilities like virtualization and cache sizes.
viewing cpu clock speed

7. Checking with dmesg

dmesg is a command used to examine kernel messages, helpful for retrieving system boot-time data, including CPU speed information.

  1. Access your command line interface and enter the following command to filter out CPU speed information:
sudo dmesg | grep MHz

This command sifts through kernel messages to find mentions of CPU clock speeds.

The output will typically mention the CPU’s operating frequency in MHz, useful for confirming if the CPU is running at the expected speed.

filtering cpu speed information from boot messages

    8. Using i7z for Intel CPUs

    i7z is a real-time CPU monitoring tool designed specifically for Intel processors. It reports on CPU cores’ clock speeds and other vital statistics, offering a real-time look at how a CPU is performing.

    1. To install i7z on Ubuntu or Debian, execute the command: 
    sudo apt-get install i7z

    This installs the i7z tool from the repository using APT.

    installling i7z on ubuntu
    1. Simply type the following command in the Terminal:
    sudo i7z

    This tool runs in a terminal window and provides a continuously updating display of CPU performance metrics.

    launching i7z to view realtime cpu speed
    1. Observe the real-time clock speed for each core. Additional details include the utilization percentage and temperature readings, giving a holistic view of how your Intel CPU is performing under various loads.
    viewing cpu clock speed in i7z

    3 Common Errors and Solutions When Checking CPU Speed Linux

    Encountering errors while attempting to get CPU frequency Linux can be frustrating. By addressing these errors, you can ensure accurate CPU clock speed readings and gain valuable insights into your system’s performance. I will explore three common errors and provide practical solutions to overcome them:

    🔍 “Unable to Find lscpu Command” Error

    If you encounter the error message “lscpu: command not found” while trying to check CPU clock speed on Linux, it indicates that the lscpu utility is not installed on your system. You can install the utility by running the appropriate command based on your Linux distribution to resolve this issue.

    • For Ubuntu and Debian-based systems, you can use sudo apt-get install util-linux, while Fedora and CentOS systems can use sudo dnf install util-linux. Once installed, running the lscpu command again will give you the CPU clock speed and other valuable information.

    “Inaccurate CPU Clock Speed Readings” Error

    Inaccurate readings of CPU clock speed on Linux can occur due to CPU throttling or incorrect system configurations. To address this issue, you can take a few steps.

    1. First, ensure your system is not experiencing thermal throttling caused by excessive heat. Clean the CPU heatsink and fan, and ensure proper airflow for efficient cooling.
    2. Secondly, update your system’s BIOS to the latest version, as it may contain bug fixes or improved compatibility with the CPU.
    3. Lastly, check your system’s power settings and ensure it is not set to a power-saving mode that may reduce the CPU clock speed.

    ⚙️  “Missing Real-time Monitoring Tools” Error

    If your Linux system lacks real-time monitoring tools to track CPU clock speed, you can address this by installing popular utilities such as htop or top.

    • To install htop, you can use sudo apt-get install htop for Ubuntu and Debian-based systems, or sudo dnf install htop for Fedora and CentOS systems.
    • For the top, this utility is usually pre-installed on most Linux distributions. Once installed, running htop or top will allow you to monitor CPU clock speed and other system metrics in real-time. 

      Linux Get CPU Frequency: Wrapping Up

      In conclusion, knowing how to check CPU frequency on Linux is crucial for optimizing performance, troubleshooting issues, and ensuring software compatibility. I have covered methods like lscpu, cpufreq-info, /proc, CPU-X, GNOME System Monitor, hwinfo, dmesg, and i7z to check CPU clock speed.

      If you’re looking to learn more, here are some additional topics you might find useful:

      Frequently Asked Questions

      How can I check the CPU clock speed of individual cores on Linux?

      To check the clock speed of individual CPU cores on Linux, you can utilize the lscpu command. Running the command in the Terminal provides detailed information about the CPU, including the clock speed of each core. Look for the CPU MHz field in the output, which displays the CPU’s clock speed. By examining the CPU MHz field for each core listed in the output, you can obtain the clock speeds of the individual cores. This information allows you to assess the performance of each core and identify any variations or imbalances within the CPU.

      Can I overclock my CPU on Linux and check the new clock speed?

      Yes, it is possible to overclock your CPU on Linux. The feasibility and success of overclocking depend on your hardware and BIOS capabilities. Once overclocked, you can use methods like the lscpu command, cpufreq-info, or monitoring tools like htop to check the new clock speed. Overclocking involves adjusting your system’s BIOS CPU multiplier or base clock frequency. However, it’s important to exercise caution and ensure adequate cooling to handle the increased heat.

      What impact does CPU clock speed have on power consumption and heat generation?

      The CPU clock speed directly impacts power consumption and heat generation. As the clock speed of a CPU increase, it requires more power to operate at higher frequencies, potentially leading to increased energy usage and higher power bills. Additionally, the power consumed by the CPU is dissipated as heat, contributing to overall heat generation in the system. CPUs running at higher clock speeds generate more heat, emphasizing the importance of proper cooling mechanisms to maintain optimal temperatures and prevent overheating.

      Ojash

      Author

      Ojash is a skilled Linux expert and tech writer with over a decade of experience. He has extensive knowledge of Linux's file system, command-line interface, and software installations. Ojash is also an expert in shell scripting and automation, with experience in Bash, Python, and Perl. He has published numerous articles on Linux in various online publications, making him a valuable resource for both seasoned Linux users and beginners. Ojash is also an active member of the Linux community and participates in Linux forums.

      Akshat

      Reviewer

      Akshat is a software engineer, product designer and the co-founder of Scrutify. He's an experienced Linux professional and the senior editor of this blog. He is also an open-source contributor to many projects on Github and has written several technical guides on Linux. Apart from that, he’s also actively sharing his ideas and tutorials on Medium and Attirer. As the editor of this blog, Akshat brings his wealth of knowledge and experience to provide readers with valuable insights and advice on a wide range of Linux-related topics.

      Share this article
      Shareable URL
      Prev Post

      How to List Tmux Sessions [3 Effective Ways]

      Next Post

      How to Do a UDP Ping in Linux [3 Effective Methods]

      Leave a Reply

      Your email address will not be published. Required fields are marked *

      Read next