HOW TO GET CENTRAL PROCESSING UNIT (CPU) INFORMATION ON LINUX TERMINAL

How to Get Central Processing Unit (CPU) Information on Linux Terminal

How to Get Central Processing Unit (CPU) Information on Linux Terminal

Blog Article



How to Get Central Processing Unit (CPU) Information on Linux Terminal

The Central Processing Unit (CPU) is the brain of your computer, responsible for executing instructions and handling tasks. Knowing the details of your CPU can be helpful in understanding your system's capabilities and optimizing its performance. In this article, we will explore how to get CPU information on the Linux terminal.

Using the lscpu Command

The lscpu command is a straightforward way to get detailed information about your CPU. To use this command, simply open your Linux terminal and type:
lscpu

This will display a list of information about your CPU, including:

  • Architecture: The type of CPU architecture (e.g., x86_64)

  • CPU op-mode(s): The operating modes supported by the CPU (e.g., 32-bit, 64-bit)

  • Byte Order: The byte order used by the CPU (e.g., Little Endian)

  • CPU(s): The number of CPUs (cores) available

  • Thread(s) per core: The number of threads per core

  • Core(s) per socket: The number of cores per socket

  • Socket(s): The number of sockets (physical CPUs) available

  • Model name: The model name of the CPU

  • CPU MHz: The current CPU frequency

  • CPU max MHz: The maximum CPU frequency

  • CPU min MHz: The minimum CPU frequency


Using the cat /proc/cpuinfo Command

Another way to get CPU information is by using the cat /proc/cpuinfo command. This command displays detailed information about each CPU core, including:

  • processor: The CPU core number

  • vendor_id: The vendor ID of the CPU manufacturer

  • cpu family: The CPU family (e.g., Intel, AMD)

  • model: The CPU model number

  • model name: The CPU model name

  • stepping: The CPU stepping (revision) number

  • cpu MHz: The current CPU frequency

  • cache size: The size of the CPU cache


To use this command, type:
cat /proc/cpuinfo

This will display a list of information about each CPU core.

Using the nproc Command

If you only need to know the number of CPU cores available, you can use the nproc command. To use this command, type:
nproc

This will display the number of CPU cores available.

Using the inxi Command

The inxi command is a powerful tool that provides detailed information about your system, including CPU information. To use this command, type:
inxi -C

This will display detailed information about your CPU, including the model name, CPU frequency, and number of cores.

Additional Tips

For more detailed information about your CPU, you can also use the following commands:

  • sudo dmidecode -t processor: Displays detailed information about the CPU, including the model name, CPU frequency, and cache size.

  • sudo lshw -class processor: Displays detailed information about the CPU, including the model name, CPU frequency, and cache size.


In conclusion, getting CPU information on the Linux terminal is easy and straightforward. By using the lscpu, cat /proc/cpuinfo, nproc, and inxi commands, you can get detailed information about your CPU, including the model name, CPU frequency, and number of cores. For more information, you can refer to the How to Get Information About Your Central Processing Unit (CPU) and Core Count on Ubuntu Terminal article.

By understanding your CPU's capabilities and limitations, you can optimize your system's performance, choose the right software, and make informed decisions when upgrading or purchasing new hardware. Whether you're a developer, administrator, or simply a curious user, knowing your CPU information is essential for getting the most out of your Linux system.

Report this page