Ssh – How to set default settings for htop

display-settingshtopssh

Occasionally, I need to check resources on several machines throughout our data-centers for consolidation recommendations and the like. I prefer htop, mostly because of the interactive feel and the display.

Is there a way to default some settings to my setup for htop? For example, one thing I'd like to always have shown is the average CPU load.

important note: Setting this on specific boxes isn't something feasible – I'm looking for maybe a way to set this dynamically every time I ssh into the box.

Is this possible at all?

Best Answer

htop has a setup screen, accessed via F2, that allows you to customize the top part of the display, including adding or removing a "Load average" field and setting it's style (text, bar, etc.).

These seem to be auto saved in $HOME/.config/htop/htoprc, which warns:

# Beware! This file is rewritten by htop when settings are changed in the interface.
# The parser is also very primitive, and not human-friendly.

I.e., edit that at your own risk. However, you should be able to transfer it from one system to another (version differences might occasionally cause a bit of an issue).

You could also set up a configuration, quit, and then copy the file, so that you could maintain a set of different configurations by swapping/symlinking whichever one with htoprc.