отображать процессы Linux (display Linux processes)
STUPID TRICKS Sampler
Many of these tricks work best when you give top a scheduling
boost. So plan on starting him with a nice value of -10,
assuming you've got the authority.
7a. Kernel Magic
For these stupid tricks, top needs full-screen mode.
• The user interface, through prompts and help, intentionally
implies that the delay interval is limited to tenths of a
second. However, you're free to set any desired delay. If
you want to see Linux at his scheduling best, try a delay of
.09 seconds or less.
For this experiment, under x-windows open an xterm and
maximize it. Then do the following:
. provide a scheduling boost and tiny delay via:
nice -n -10 top -d.09
. keep sorted column highlighting Off so as to
minimize path length
. turn On reverse row highlighting for emphasis
. try various sort columns (TIME/MEM work well),
and normal or reverse sorts to bring the most
active processes into view
What you'll see is a very busy Linux doing what he's always
done for you, but there was no program available to illustrate
this.
• Under an xterm using `white-on-black' colors, on top's Color
Mapping screen set the task color to black and be sure that
task highlighting is set to bold, not reverse. Then set the
delay interval to around .3 seconds.
After bringing the most active processes into view, what
you'll see are the ghostly images of just the currently
running tasks.
• Delete the existing rcfile, or create a new symlink. Start
this new version then type `T' (a secret key, see topic 4c.
Task Area Commands, SORTING) followed by `W' and `q'.
Finally, restart the program with -d0 (zero delay).
Your display will be refreshed at three times the rate of the
former top, a 300% speed advantage. As top climbs the TIME
ladder, be as patient as you can while speculating on whether
or not top will ever reach the top.
7b. Bouncing Windows
For these stupid tricks, top needs alternate-display mode.
• With 3 or 4 task displays visible, pick any window other than
the last and turn idle processes Off using the `i' command
toggle. Depending on where you applied `i', sometimes several
task displays are bouncing and sometimes it's like an
accordion, as top tries his best to allocate space.
• Set each window's summary lines differently: one with no
memory (`m'); another with no states (`t'); maybe one with
nothing at all, just the message line. Then hold down `a' or
`w' and watch a variation on bouncing windows -- hopping
windows.
• Display all 4 windows and for each, in turn, set idle
processes to Off using the `i' command toggle. You've just
entered the "extreme bounce" zone.
7c. The Big Bird Window
This stupid trick also requires alternate-display mode.
• Display all 4 windows and make sure that 1:Def is the
`current' window. Then, keep increasing window size with the
`n' interactive command until all the other task displays are
"pushed out of the nest".
When they've all been displaced, toggle between all
visible/invisible windows using the `_' command toggle. Then
ponder this:
is top fibbing or telling honestly your imposed truth?
7d. The Ol' Switcheroo
This stupid trick works best without alternate-display mode,
since justification is active on a per window basis.
• Start top and make COMMAND the last (rightmost) column
displayed. If necessary, use the `c' command toggle to
display command lines and ensure that forest view mode is
active with the `V' command toggle.
Then use the up/down arrow keys to position the display so
that some truncated command lines are shown (`+' in last
position). You may have to resize your xterm to produce
truncation.
Lastly, use the `j' command toggle to make the COMMAND column
right justified.
Now use the right arrow key to reach the COMMAND column.
Continuing with the right arrow key, watch closely the
direction of travel for the command lines being shown.
some lines travel left, while others travel right
eventually all lines will Switcheroo, and move right