32

Can I somehow modify htop's default view to display processes sorted by CPU usage? I want htop to "remember" my view/sort method.

If it's relevant, I'm currently on Xubuntu 13.10.

Braiam
  • 67,791
  • 32
  • 179
  • 269
henry
  • 2,045

3 Answers3

35

Run htop, press F6, select CPU%.

Quit by using F10

If it doesn't remember your settings check your ~/.config/htop/htoprc file if it is writable by your user. You might make it writable like this:

chown $USER ~/.config/htop/htoprc

Or you can try removing it and let htop generate a new one, maybe the old one is corrupted somehow.

rm ~/.config/htop/htoprc
galoget
  • 2,963
falconer
  • 15,026
  • 3
  • 48
  • 68
11

I noticed I had to actually quit properly using F10 and not Ctrl + C for htop to save the sort by column.

  • Please make sure to write a complete answer instead of a partial one. Even though others may have provided the information doesn't mean it should be left out of your answer. You could also leave a comment in case you just wanted to let the poster know. – Xweque Feb 22 '15 at 20:05
  • 2
    Whats wrong with my answer?? – John Mark Scarborough Feb 23 '15 at 20:54
  • It's probably best to mention how to change the sort order in the first place. – LovesTha May 02 '17 at 03:06
3

Other solutions are better, but if all else fails, you can make an alias for htop -s PERCENT_CPU.

Mark
  • 293