如何让 linux top 命令以兆字节而不是千字节显示内存摘要

Mic*_*rey 18 linux memory redhat top

红帽EL5

我按照我喜欢的方式配置了我的顶部,以 MB 为单位显示内存摘要和交换摘要。我不得不关闭我的外壳,然后当我重新打开它时,它又以(默认?)千字节显示。

我已经搜索了 google 和 top help 并管理了页面。我似乎无法在 MB 选项中找到显示。虽然,我确实发现了许多其他有些奇怪的选择......

如果有人知道我肯定会很感激。

谢谢!

小智 17

我知道我迟到了,但我想你用过:

top -M
Run Code Online (Sandbox Code Playgroud)

来自 RHEL 5 的 tom 手册页:

-M : Detect memory units
Show memory units (k/M/G) and display floating point values in the memory summary.
Run Code Online (Sandbox Code Playgroud)

  • tom -M 不适用于 ubuntu,只适用于 centos (7认同)

小智 13

在 linux 上,您可以使用ekey 来更改任务内存规模,范围从字节到 PB。选择您喜欢的内容后,按W( shift + w) 将更改保存到~/.toprc


小智 5

键入大写字母“E”在 KiB、MiB、GiB、TiB、PiB 和 EiB 之间循环。


bin*_*dbn 2

原始top(procps 3.2.8)无法显示Mb内存摘要(我查看源代码)。