bashtop-command

How to suppress the general information for top command


I wish to suppress the general information for the top command using a top parameter.

By general information I mean the below stuff :

top - 09:35:05 up  3:26,  2 users,  load average: 0.29, 0.22, 0.21
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.3%us,  0.7%sy,  0.0%ni, 96.3%id,  0.8%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   3840932k total,  2687880k used,  1153052k free,    88380k buffers
Swap:  3998716k total,        0k used,  3998716k free,   987076k cached

What I do not wish to do is :

top -u user | grep process_name

or

top -bp $(pgrep process_name) | do_something

How can I achieve this?

Note: I am on Ubuntu 12.04 and top version is 3.2.8.


Solution

  • It's known as the "Summary Area" and i don't think there is a way at top initialization to disable those.

    But while top is running, you can disable those by pressing l, t, m.

    From man top:

     Summary-Area-defaults
      'l' - Load Avg/Uptime  On  (thus program name)
      't' - Task/Cpu states  On  (1+1 lines, see '1')
      'm' - Mem/Swap usage   On  (2 lines worth)
      '1' - Single Cpu       On  (thus 1 line if smp)