19

How can I configure 'top' to show all values in human readable format instead of long numerics. I am using Ubuntu 14.04.

Sample output I am getting at the moment:

top - 11:39:56 up 14:46, 11 users,  load average: 1.14, 1.61, 1.35
Tasks: 248 total,   2 running, 246 sleeping,   0 stopped,   0 zombie
%Cpu(s):  3.5 us,  1.4 sy,  0.1 ni, 93.3 id,  1.2 wa,  0.5 hi,  0.0 si,  0.0 st
KiB Mem:   8040568 total,  7814164 used,   226404 free,   155912 buffers
KiB Swap:  8249340 total,   208240 used,  8041100 free.  4688852 cached Mem

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND                                                                      
 7106 pavan     20   0 1439336  58244  17120 S   2.7  0.7  11:12.32 compiz                                                                       
19358 pavan     20   0  685616  27460  11568 S   2.7  0.3   0:52.53 gnome-terminal                                                               
 1011 root      20   0  328568  37232  22796 S   2.0  0.5   5:30.76 Xorg                                                                         
 8879 pavan     20   0  895572 144464  13112 S   2.0  1.8   2:42.05 chrome                                                                       
 7135 pavan     20   0  422640   8956   6436 S   1.7  0.1   4:38.53 indicator-multi                                                              
 8842 pavan     20   0 1113460  62956  14084 S   1.3  0.8   5:20.84 chrome                                                                       
 6879 pavan     20   0  524448  45100  10440 S   1.0  0.6   3:18.77 unity-panel-ser                                                              
 8060 pavan     20   0 1107068 171568  52644 S   1.0  2.1  13:41.37 chrome                     

1 Answer 1

30

If you press h, the help screen contains, among other things:

  Z,B,E,e   Global: 'Z' colors; 'B' bold; 'E'/'e' summary/task memory scale

Pressing e cycles through mega, giga, tera and peta-sized figures (and the default suffixless kilobyte) values.

After selecting the size, press W to have top save your preferences to ~/.toprc. Now it should start with the preferred size.

7
  • 4
    That worked, thanks. Is there anyway I can force top to show human readable numbers by default?
    – kn_pavan
    Sep 11, 2014 at 6:33
  • and in earlier releases, like 12.04? Oct 13, 2016 at 7:30
  • @mirkobrankovic tough luck, I guess. The manpage doesn't mention the e command, and it doesn't look like you have other ways.
    – muru
    Oct 14, 2016 at 5:15
  • 1
    yeah, i saw man page, i guess htop will be handy there on 12.04 Oct 14, 2016 at 7:27
  • 1
    @kn_pavan use W to save the .toprc configuration Aug 5, 2019 at 17:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .