PDA

View Full Version : running top, w/o a 3840 x 2880 mon to run it on


AHunter3
12-16-2005, 11:36 AM
Running top in the terminal gives me a display of running processes, limited by windowsize —*and while I can expand the Terminal window to screen-height, that still cuts off lots of processes. And unlike, say, man pages, there's no obviously apparent keystroke to page down and show the second window's worth of processes, nor does it scroll.

Yeah, I know I could crank up Activity Monitor instead, but I'm curious. This had to be something that Unix folk with nary but a command line knew how to deal with. What's the trick?

TrumpetPower!
12-16-2005, 12:34 PM
It depends on what you want to do. Usually, top(1) is just used to keep an eye on the...ah..top so-many processes. If you actually want to see everything that's going on, then what you really want is ps(1).

If you want it to be continuously updated, stick it in an infinite loop like so:

while :; do clear; date; echo; ps auxwww; sleep 4; done

How to tweak that to your liking is, as they say, left as an exercise for the reader.

Cheers,

b&

hayne
12-16-2005, 01:35 PM
You could run 'top' with the "-l" option to tell it the number of times you want it run. Then it won't update in place, but will output the full results for each iteration separately like other commands.
top -l 99 -s 10

And you can use the "-o" option to specify which criterion is used for sorting - to determine which processes appear at the top.
top -o cpu

Or you could run it with the "-X" option that will enable all of the interactive commands described in the man page ('man top')