Fwd: Busy Box command lines

Denys Vlasenko vda.linux at googlemail.com
Fri May 6 18:53:12 UTC 2011

On Fri, May 6, 2011 at 4:08 PM, Harald Becker <ralda at gmx.de> wrote:
>  Hi!
>> Is it possible using command ps to have busy box provide a list of the
>> top 10 memory/cpu files in use?
> The functionality to display CPU or memory utilization is not included
> in Busybox ps (at least in older versions). The lacking if those is one
> of the features I'm rally missing.
> ... else you could do something like this:
> ps -o pcpu,pid | tail -n +2 | sort -r | head -10
> ps -o format = display status columns you like
> tail -n +2 = suppress header line
> sort -r ... = sort status output the way you like
> head -10 = display wanted top most lines of sorted status
> ... but Busybox ps lacks pcpu (%cpu) and pmem (%mem) :-(

Yeah, needs to be fixed.

Meanwhile, I just committed a small change which makes *top*
a bit more useful in this regard: now you can feed it input by pipe:

echo .m.s.s.s.s.s.s.q | busybox top -b

and it will execute it as if it is entered from keyboard.
"." is an invalid key, here is causes top to generate
one iteration of output.


More information about the busybox mailing list