17

How can I show the CPU usage side by side rather than a list?

I have this : enter image description here

but I want to show it like this: enter image description here

Jeff Schaller
  • 67,283
  • 35
  • 116
  • 255
nafas
  • 313

5 Answers5

19

Go to settings (F2), under Meters, you select what is in the left column and what in the right column. Instead of CPUs (1/1) in the left column, select CPUs (1/2) for the left column and CPUs (2/2) for the right column. F10 to save the changes and it's done.

orion
  • 12,502
  • 1
    I needed to run htop as root to make the settings persistent. – Vara Jan 16 '18 at 14:19
  • 3
    If your CPU list takes up the whole screen, going to settings does nothing since it's off the screen. The easiest way to fix this is to maximize your terminal window and decrease font size until you can see the settings. – thc May 13 '19 at 18:36
9

As I answered to this more recent version of the same question, this problem can also occur when you use a version of htoprc that has been optimized for a computer with less CPUs. This is like to happen when you use LDAP or some other system to share your home folder between computers.

You can solve this by deleting .config/htop/htoprc and starting htop on the computer with the most cores of the one you use. This will write an htoprc file optimized for many cores (i.e. with four columns for CPUs).

For more details, visit my answer on the other question that I linked above.

m00am
  • 251
3

Or if F2 doesn't help, use Shift-S which will bring you to Settings. You do not need to be root to achieve this.

Panki
  • 6,664
  • Neither of these if setting wont display. I have 40 lines of CPU (out of 128). no settings...... Need to edit the rc file ; https://github.com/hishamhm/htop/issues/562 – mckenzm Mar 19 '19 at 03:57
  • 1
    @mckenzm Try deleteing .config/htop/htoprc and launch htop on the server with 128 cores. You are most certainly using an htoprc optimized for another computer. See my answer(s) for details. – m00am Nov 08 '19 at 09:47
  • Indeed, rm is the great cleanser. You are correct, it is an aws instance. – mckenzm Nov 09 '19 at 22:41
2

If you have upgraded CPU and dont care about losing your htop config, then easiest way is

mv ~/.config/htop/htoprc ~/.config/htop/htoprc.bak

It works because on first run htop automatically tries to arrange cpu monitors in best manner

1

If you press the F2 key, you will be able to organize the meters between both columns.

Spack
  • 1,997