234 lines
15 KiB
Plaintext
234 lines
15 KiB
Plaintext
|
|
Episode: 1082
|
||
|
|
Title: HPR1082: LiTS 016: top pt 4: Alternate Windows
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1082/hpr1082.mp3
|
||
|
|
Transcribed: 2025-10-17 18:38:18
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
Welcome to Linux in the Shell episode 16, top part 4 alternate windows.
|
||
|
|
My name is Dan Washco, I'll be your host today, and we're going to finish up our coverage
|
||
|
|
of top with the final two topics of top alternate window display and color syntax that you're
|
||
|
|
ready to be done with top.
|
||
|
|
You get the full story, huh?
|
||
|
|
Well, regardless, make sure you head on over to the website, Linux in the Shell.org,
|
||
|
|
to read the entry, you get a full understanding and watch the video.
|
||
|
|
And again, I'd like to thank Kakar Public Radio for hosting the website and the video
|
||
|
|
and audio and everything else, Kakar Public Radio.
|
||
|
|
Support them.
|
||
|
|
Do a show.
|
||
|
|
Listen.
|
||
|
|
It's great stuff.
|
||
|
|
And I thank them.
|
||
|
|
All right.
|
||
|
|
Top.
|
||
|
|
Let's talk about alternate display.
|
||
|
|
When you start up top, you're in full screen mode.
|
||
|
|
And you have your summary area at the top, and you have your task window at the bottom
|
||
|
|
listing all your threads.
|
||
|
|
And of course, the summary window takes up about a quarter of the screen in a rest of it is the task window.
|
||
|
|
There's an alternate display for top.
|
||
|
|
And that's toggled on and off by pressing the capital A.
|
||
|
|
So shift A will toggle on the alternate display.
|
||
|
|
And when you do that, the task area will be broken up in the four equal parts.
|
||
|
|
Each one of those parts is called the field group.
|
||
|
|
And those field groups display the task area information in a different way.
|
||
|
|
By default, what you have of the four windows that you will see is the first one is displayed by the default method.
|
||
|
|
And that is going to be unless you changed it percent CPU.
|
||
|
|
Now remember, you can see the different fields or whatever field it's sorted on by pressing the X key at any time.
|
||
|
|
And it will highlight that field.
|
||
|
|
The other three fields, accordingly, by default, are going to be job.
|
||
|
|
That's going to be the PID.
|
||
|
|
And it also is going to be memory.
|
||
|
|
It's the third one.
|
||
|
|
And the fourth one is going to be by user.
|
||
|
|
Those are the defaults.
|
||
|
|
And of course, you can toggle through, but before you get to the control of that, how we did that, one thing to be cognizant of is when you enter into alternate window mode by pressing shift A.
|
||
|
|
Look in the upper left-hand corner of the summer area.
|
||
|
|
And what you used to say top is now going to show the field group you're on.
|
||
|
|
For instance, as soon as you start it, it's going to show one colon DEF.
|
||
|
|
And then if you go to a switch to the other window, task, task group field group, sorry, it'll show two colon jobs.
|
||
|
|
And that, by default, is the field group name.
|
||
|
|
And the name is going to be the window, the task window that it is, field group number, and what it's sorting on.
|
||
|
|
Default is the default one, which is CPU.
|
||
|
|
The set two, field group two shows job, which is the PID.
|
||
|
|
And again, you can see the fields by pressing X.
|
||
|
|
So be aware that it'll show you a field group you're on at the top.
|
||
|
|
Now, how do you switch between field groups?
|
||
|
|
Well, that's very easy.
|
||
|
|
When you're in alternate mode and displaying the field group, you press the A key to move down the window field group list.
|
||
|
|
That's going from, or I should say, moving up, because you're moving from one to two to three to four.
|
||
|
|
But you're actually moving down the list in the screen, field groups, or the W, which is to move back up again, or moving from field group three to two from two to one.
|
||
|
|
So if you're looking at the top screen, A moves you down through the list, W moves you up.
|
||
|
|
And if you hit the bottom, it'll wrap around.
|
||
|
|
So when you hit four, it'll wrap back up to one.
|
||
|
|
If you hit A, if you're in one, and you hit W, it'll go wrap down the four.
|
||
|
|
So that's how you can navigate.
|
||
|
|
Another way to navigate is to press the G key.
|
||
|
|
And it'll say choose field group between one to four.
|
||
|
|
And if you press any one of those numbers, one, two, three, or four, it'll switch to that field group.
|
||
|
|
Now, here's an interesting thing.
|
||
|
|
Okay?
|
||
|
|
A and W do not work in full screen mode.
|
||
|
|
If you try and use A and W in full screen mode, you will get a warning that says,
|
||
|
|
a man to disable A mode required, capital A mode required.
|
||
|
|
But if you press the G key, it will allow you to choose a field group between one and four.
|
||
|
|
So what does this mean?
|
||
|
|
Well, this means good fellows and ladies.
|
||
|
|
That alternate display mode is always available that when you look at full screen top mode,
|
||
|
|
which you've been looking at this whole time, you have four other windows you can play around with.
|
||
|
|
And if you press G and type in one, two, three, or four, actually not one,
|
||
|
|
because one's the one you're on, two, three, or four, that will take you to the other mode.
|
||
|
|
In full screen.
|
||
|
|
Okay? So you actually have four different top windows going on at the same time.
|
||
|
|
In full screen mode or alternate mode.
|
||
|
|
So be aware of that.
|
||
|
|
Now, when you are in a top field group, okay?
|
||
|
|
And it shows at the top, the upper left hand corner of top, what field group you're in.
|
||
|
|
If you wanted to change the name of that field group, just press Shift G, capital G.
|
||
|
|
And it will prompt you to whatever you want to change the name to.
|
||
|
|
Now, field group takes the same commands that full screen window takes.
|
||
|
|
So you can add fields, remove fields, alter fields.
|
||
|
|
You can switch whatever you want it to sort on.
|
||
|
|
And then in that way, if you're changing the sort, you can press Shift G
|
||
|
|
and change the name of that field group to reflect what you're sorting on, or you can call whatever you want to.
|
||
|
|
The choice is yours.
|
||
|
|
When you are on a field group, you can hide it by pressing the minus key.
|
||
|
|
Okay, now that hides the field group.
|
||
|
|
And if you want to show it again, you press the minus key, and it shows the field group.
|
||
|
|
What it doesn't hide is the navigation capability to that field group.
|
||
|
|
So if you actually hide it, like if I'm on field group two, and I hide it,
|
||
|
|
I'm only going to see one, three, and four.
|
||
|
|
But in the upper left hand corner of top, I see that it still shows two colon job.
|
||
|
|
So I'm still technically on it.
|
||
|
|
Now, the important thing to note, which I forgot to mention earlier,
|
||
|
|
is that each field group has its own summary area at the top.
|
||
|
|
So when you're cycling through the field groups, the summary area will change accordingly to that field group summary area.
|
||
|
|
Now, by default, the summary area is going to show the same thing for all field groups.
|
||
|
|
But some of the highlight fields, or what it might be looking at, might change,
|
||
|
|
you can toggle things on and off in the summary group, show multiple CPUs, hide the memory, hide the swap,
|
||
|
|
whatever you want to do, and it will apply it to that field group summary area, but none of the others.
|
||
|
|
So just be aware of that.
|
||
|
|
So when you hide a field group, and you press the A or W key to cycle through,
|
||
|
|
you will actually land on that field group when you cycle through it, but you won't see it, it will be hidden.
|
||
|
|
So you can press the minus key to show it again.
|
||
|
|
There's another option here when you're on a field group to press the underscore key.
|
||
|
|
Shift minus, which is that underscore key, shift minus, and it will switch that field group to full screen.
|
||
|
|
So now you're in full screen field group mode.
|
||
|
|
You are looking at that field group in full screen.
|
||
|
|
So if I was on two, and I pressed shift minus, I am now showing field group two in full screen.
|
||
|
|
And if I press the shift minus or underscore key again, I'm back to normal mode.
|
||
|
|
Now, what happens if I have hidden the field group and press shift minus?
|
||
|
|
Well, it will bring up the field group, but there will be nothing in the task area because it's hidden.
|
||
|
|
I can, you know, show up by hitting the minus key again, and it will show the task area.
|
||
|
|
If you hit shift minus for the underscore, it will move you out of full screen mode back into field group mode.
|
||
|
|
But if you have hidden it in field group mode, you will have to re-enable it with the minus key again.
|
||
|
|
It won't show it in field group mode if you've hidden it previously.
|
||
|
|
And so you turn it back on.
|
||
|
|
Now, you cannot use the shift minus key if you haven't started alternate display.
|
||
|
|
So if you do shift A and get out of alternate display and do the underscore shift minus,
|
||
|
|
it will tell you just like it would with A and W keys that you need to be an alternate display mode for it to work.
|
||
|
|
So be aware of that.
|
||
|
|
Minus key won't work either. It will tell you that you need to be an alternate display mode.
|
||
|
|
Okay, so alternate display mode.
|
||
|
|
I think we pretty much covered it all there.
|
||
|
|
Recap, shift A to get into it, A, W to navigate through it or G to choose to field manually.
|
||
|
|
Minus key to hide a field group, underscore key to switch field group to full screen mode.
|
||
|
|
We'll toggle this both on and off.
|
||
|
|
And capital G, shift G, to change the name of the field group.
|
||
|
|
And that's pretty much, oh, one other thing in field groups to be aware of.
|
||
|
|
Now, if you, all the different configurations as you can do in setting things up,
|
||
|
|
we had talked in the past where you can use N to specify a number of lines.
|
||
|
|
You could use U or capital U to specify the user.
|
||
|
|
You can limit by PID and stuff like that.
|
||
|
|
You could toggle on idle task or not show idle task.
|
||
|
|
You can navigate using up and down arrows page down to page up and everything.
|
||
|
|
And if you want to get it back to where, to starting point, you press equal.
|
||
|
|
And that will revert the like, you know,
|
||
|
|
negate any max tasks, users filters, idle task filters,
|
||
|
|
and take you up to the top of the top window and back to normal.
|
||
|
|
You can use those in any of the, if you press those in any one of the field groups,
|
||
|
|
it will do that behavior.
|
||
|
|
But then there's another one called plus.
|
||
|
|
If you hit the shift plus, or if you hit plus, which is shift equal,
|
||
|
|
it will do that for all windows.
|
||
|
|
Okay, you'll still retain customizations, but it'll wipe out any of the filters,
|
||
|
|
take you back to the top of the screen.
|
||
|
|
Like it did with equal command, but it'll do it for all the different field groups.
|
||
|
|
Equal will only apply to the current field group you're on, plus will apply it to all.
|
||
|
|
All right.
|
||
|
|
Last topic that we're going to talk about is syntax highlighting, color highlighting in top.
|
||
|
|
And it might be handy to do color highlighting in different field groups,
|
||
|
|
so you can easily differentiate between what you're looking.
|
||
|
|
If you press the shift Z key, regardless of whether you're in full screen mode,
|
||
|
|
or in alternate display mode, it will take you to the color mapping screen.
|
||
|
|
And at the top half of it is going to be an example of what is currently your color mapping
|
||
|
|
for that field group or the full screen, whatever.
|
||
|
|
It's going to be for the field group, okay, whatever you're on.
|
||
|
|
And then the bottom half tells you first to select target as an uppercase letter.
|
||
|
|
And then for S is for the summary area, H is for column headers,
|
||
|
|
M is for messages and prompts, and then T is for task information.
|
||
|
|
Now those are all capital, capital S, capital H, capital M, capital T.
|
||
|
|
So you have to use the switch between the target, okay, you have to use shift and SHM or T.
|
||
|
|
Now you can see what the target is, because right underneath that where it tells you the target definitions,
|
||
|
|
it says in a list the color options available to you.
|
||
|
|
Colors are by numbers, 0 equals black, 1 equals red, 2 is green, 3 is yellow, 4 is blue, 5 is magenta, 6 is cyan, and 7 is white.
|
||
|
|
Now this is all listed there, it's a nice little handy menu that you can see.
|
||
|
|
And then under that it says selected, colon, target, and it tells you what target is selected.
|
||
|
|
I think by default it's task or T task information.
|
||
|
|
And then as a semicolon it says color, what color number is selected.
|
||
|
|
If you press shift S, it switches it to summary area, shift M, it switches it to message,
|
||
|
|
shift agent switches it to column.
|
||
|
|
And when you choose whatever color you want, 0 to 7, it will show what's going to change in the example above.
|
||
|
|
Okay, so you can choose whatever color schemes you want.
|
||
|
|
And it will display those by default at the top and show what you're going to select.
|
||
|
|
You can cycle between field groups by pressing the A and W commands.
|
||
|
|
There are keys on here and it will change to the other field groups.
|
||
|
|
And when you're finished and you're happy with your selections, you press enter to commit and end.
|
||
|
|
Or at any time you can press Q to abort any of the changes and go back.
|
||
|
|
So when you have chosen colors or you're happy with your color scheme,
|
||
|
|
you can toggle color on and off by pressing the Z command, Z key.
|
||
|
|
All right, that toggles colors on and off.
|
||
|
|
And if you're in alternate display mode, it's only going to toggle the colors on and off for that current field group.
|
||
|
|
You'd have to do a cycle between them that turn the different colors on or W, of course.
|
||
|
|
And it'd be good.
|
||
|
|
In full screen mode, it toggles and on and off for full screen mode.
|
||
|
|
Now, there's also highlighting, which it highlights important fields, stuff that changes and things like that.
|
||
|
|
I'm sorry, bolding that's highlighting.
|
||
|
|
That's called use toggle button off with the shift B key or the capital B.
|
||
|
|
And you can turn that on and off.
|
||
|
|
If you set up top and you really like your configuration, you really want to keep it,
|
||
|
|
you can write it out to the top configuration file by pressing the shift W.
|
||
|
|
Capital W and it will write to your home directory and it will write it to
|
||
|
|
the top RC, I believe it's a default name.
|
||
|
|
So just be aware of that.
|
||
|
|
It'll tell you where it wrote it to.
|
||
|
|
So next time you start top, it will be in all the configurations that you have.
|
||
|
|
If you ever want to get rid of your configurations, just do RM, that top RC.
|
||
|
|
And you'll be good to go.
|
||
|
|
That is top pretty much an enough shell.
|
||
|
|
There's probably a little more that you can explore.
|
||
|
|
Do changing the name of top different configuration files, that sort of thing.
|
||
|
|
So make sure that you thoroughly read the top man and info pages if you want more information.
|
||
|
|
And enjoy it.
|
||
|
|
Top is very useful, very handy, very complex, but yet elegant and simple at the same time.
|
||
|
|
So a lot you can do with top and a lot of great information it will show you.
|
||
|
|
Hopefully these four episodes have really rounded out your understanding of top
|
||
|
|
and what things are and what they mean.
|
||
|
|
And we'll give you a good leg up when you're monitoring your Linux and BSD systems.
|
||
|
|
I want to thank you very much for listening to Linux in the shell.
|
||
|
|
And remember, contribute to hacker public radio.
|
||
|
|
Either by listening to the episodes, providing feedback and or creating your own episodes.
|
||
|
|
Head on over to Linux in the shell.org to watch this video episode.
|
||
|
|
And also to redo the reading of the write up, to further solidify your understanding of top.
|
||
|
|
Thank you very much and I'll see you next episode for some handy dandy command.
|
||
|
|
You have been listening to Hacker Public Radio at hackerpublicradio.org.
|
||
|
|
We are a community podcast network that releases shows every weekday on day through Friday.
|
||
|
|
Today's show, like all our shows, was contributed by a HBR listener by yourself.
|
||
|
|
If you ever consider recording a podcast, then visit our website to find out how easy it really is.
|
||
|
|
Hacker Public Radio was founded by the Digital.Pound and the Infonomicom Computer Club.
|
||
|
|
HBR is funded by the binary revolution at binref.com.
|
||
|
|
All binref projects are crowd-responsive by linear pages.
|
||
|
|
From shared hosting to custom private clouds, go to lunarpages.com for all your hosting needs.
|
||
|
|
Unless otherwise stasis, today's show is released under a creative comments,
|
||
|
|
attributions, share a like, videos or license.
|