Identify Number of Processors on a Linux Box

Windows Articles

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...

How to install Screaming Frog SEO Spider on Ubuntu 20.04 / 18.04?

If you are working with blogs and content creation then you should know about SEO. Or in the best case, you have...

How to Configure a Firewall in Ubuntu 20.04 / Debian 10?

There is nothing safe from hackers on the Internet, however, we can implement security measures to be more protected against an attack. With this...

Linux box is a computer that is running with the power of a Linux operating system. As a part of the machine, the processor is a very important part as it enables performing all the tasks possible. In fact, the processor is one of the major components of a computer that you need to keep your eye on.

Today’s modern processors come up with multiple cores and hyper-threading that allows the processor to perform parallel tasks simultaneously. The more cores, the better performance at heavy load works. Check out the comparison between Intel and AMD processors.

Willing to find out how many cores are present in your system? Let’s find out!

Finding out processor core number

The simplest method for figuring out your processor number is by using a tool “nproc”. It’s a part of the Linux coreutils. Run the following command –

nproc --all

There’s another way to obtain the same result. This one will also allow you some additional information on your processor.

lscpu | grep 'CPU(s)'

You can also examine the “cpuinfo” file from “/proc” filesystem.

grep processor /proc/cpuinfo | wc -l

There are also a number of other information on the processor in the “cpuinfo” file.

cat /proc/cpuinfo | grep "model name"
cat /proc/cpuinfo | grep "cpu cores"

In the present world of hyper-threading, the number of actual cores (physical cores) and threads (logical cores) can also be separated.

# Get number of physical core(s)
lscpu -p | egrep -v '^#' | sort -u -t, -k 2,4 | wc -l

# Get number of logical core(s)
lscpu -p | egrep -v '^#' | wc -l

If your Linux system doesn’t have the above tools, you can also use this following command for getting the same result –

getconf _NPROCESSORS_ONLN

With root privilege, you can directly get processor information using “dmidecode”.

dmidecode -t 4 | egrep 'Socket Designation|Count'

If you’re interested in getting a full, system-wide specification, you should use other tools like Superfetch or Neofetch.

Enjoy!

More articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest article

How to compress large videos in Windows 10

Hello, how are you? Multimedia resources are definitely used in any system. Indeed, we live in the age of technology. That's why...

How to get Google Opinion Rewards in any Country

Greetings! Google Opinion Rewards is a cool app, which will allow you to earn credit, to spend it on the Google Play...

How to change the hostname on Ubuntu?

This simple tutorial will teach you how to change the hostname on Ubuntu. The steps we will tell you here will work...

How to install Screaming Frog SEO Spider on Ubuntu 20.04 / 18.04?

If you are working with blogs and content creation then you should know about SEO. Or in the best case, you have...

How to Configure a Firewall in Ubuntu 20.04 / Debian 10?

There is nothing safe from hackers on the Internet, however, we can implement security measures to be more protected against an attack. With this...
x