通过此命令行,我可以看到进程和 RAM 使用情况(单位为 MB)
ps aux | awk'{print $6/1024" MB\t\t" $11}'|sort -rn|less
问题在于排序
9.95703 MB /usr/lib/systemd/systemd-journald
9.89062 MB /usr/sbin/winbindd
9.76953 MB /usr/sbin/winbindd
9.69922 MB php-fpm:
9.69922 MB php-fpm:
9.69531 MB php-fpm:
9.69531 MB php-fpm:
9.69531 MB php-fpm:
93.4297 MB db_arc1_FREE
9.31641 MB winbindd:
9.31641 MB /usr/sbin/snmpd
如何正确排序才能使输出变成这样?
93.4297 MB db_arc1_FREE
9.95703 MB /usr/lib/systemd/systemd-journald
9.89062 MB /usr/sbin/winbindd
9.76953 MB /usr/sbin/winbindd
9.69922 MB php-fpm:
9.69922 MB php-fpm:
9.69531 MB php-fpm:
9.69531 MB php-fpm:
9.69531 MB php-fpm:
9.31641 MB winbindd:
9.31641 MB /usr/sbin/snmpd