Human readable: ls -h for top and ps

David Smith DavidSmith at byu.net
Wed Feb 23 17:13:05 MST 2005


When using ps and top, I would like to read virtual memory size and
resident memory size in human readable format (like 1.0 M instead of
1032), much like 'ls -h' does for file sizes.

So, rather than this:

  USER PID %CPU %MEM    VSZ  RSS TTY  STAT START  TIME COMMAND
  root   1  0.0  0.0   1492  480 ?    S    Feb10  0:00 init [2]
  root 542  0.0  0.0   6264  728 ?    S    Feb10  0:00 /usr/sbin/ypbind
  root 552  0.0  0.1  12356 1044 ?    Ss   Feb10  0:36 /usr/sbin/nscd

I'd like this:

  USER PID %CPU %MEM    VSZ   RSS   TTY STAT START  TIME COMMAND
  root   1  0.0  0.0   1.5M  480K   ?   S    Feb10  0:00 init [2]
  root 542  0.0  0.0   6.3M  728K   ?   S    Feb10  0:00 /usr/sbin/ypbind
  root 552  0.0  0.1  12.4M  1.0M   ?   Ss   Feb10  0:36 /usr/sbin/nscd

Is this possible?

--Dave



More information about the PLUG mailing list