Supported command line options for top

Latest response

In RHEL 6.x you could run the top command with the -M option:;

[jenkins-ci@dubengvm65]~ $top -M

top - 13:33:07 up 44 days,  4:17,  1 user,  load average: 0.00, 0.00, 0.00
Tasks: 150 total,   1 running, 149 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.1%sy,  0.0%ni, 99.8%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:    13.599G total,   12.931G used,  684.629M free,  311.203M buffers
Swap: 3967.996M total, 4744.000k used, 3963.363M free, 3103.844M cached

but on RHEL 7.x the -M option is not supported. Any ideas why this was removed, there does not seem to be any way to specify units to top from the command line now?

Responses

Hi John,

RHEL 6 Systems are shipped with procps which contains top and RHEL 7 is shipped with procps-ng. On RHEL 7 you can Press 'E' in interactive mode to switch to a different unit representation.

reference: man 1 top ... 2c. MEMORY Usage This portion consists of two lines which may express values in kibibytes (KiB) through exbibytes (EiB) depending on the scaling factor enforced with the `E' interactive command. ...

Good question John. My personal preference is top -M but as mentioned by Steven, RHEL 7 requires you to execute top command then press 'E'

Hi,

It does not seem to be possible to do it on RHEL7 without interactive "-E" option.

At least easy sorting on any field is helpful:

top -o %MEM -n 1

top -o VIRT -n 1

top -o RES -n 1

And so on.

Regards,

Dusan Baljevic

The maintainers of procps-ng say that -M was a Red Hat specific command line option: https://gitlab.com/procps-ng/procps/issues/53

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.