How can I see how many processor cores are working?

Solution 1:

Type:

lscpu

in the terminal and press ENTER.

Now you have the info on cores used in your Ubuntu installation.

Solution 2:

You can see the usage of your CPU cores using top command.

  1. Open a Terminal.
  2. Type top. You will see some information about tasks, memory etc.
  3. Type 1 to show individual CPU usage. You will see something like:

top

To start a new process which should execute only in one core, you can use taskset command.

taskset -c 0 executable

To monitor the existing process's CPU affinity, you can use this command:

taskset -cp $(pgrep -f executable)

note that the executable identity you will pass to this command can be './executable' if you started it that way.

Solution 3:

As you have not specified your Desktop environment I will assume you are using Using Ubuntu

For a graphical way to check your cpu usage, search your system for an application called System monitor.

The Resources tab will show activity of each core

enter image description here

Whilst the Processes tab will show cpu usage for individual programmes.

enter image description here

Solution 4:

htop tool provides graphs for cpu core(s) usage

install htop via terminal:

apt-get install htop

run htop via terminal:

htop

htop in the ubuntu terminal looks like this

Solution 5:

Sensors does this too, but it also tells you the temperature the cores are running at, very cool.

Type sensors in the terminal and it will tell you if you already have it installed, once it's installed you just write sensors here be sensors