please go to the line the computer guy dot com in order to view schematics, code and Maur for the projects that you are learning about.
So today's video I'm going to show you how to use Top Top is essentially a task manager for the Lenox operating system on the command line.
Basically task manager in the Windows world.
If you open up task manager, you can see how much of the CPI was being used.
You could see how much from the ram is being used.
You can see what processes are using CPU and RAM, what users are using those processes so on and so forth.
So basically, all Top is a task manager that is included with Lennox that you can use at the command line.
Now it is important, understand when I show you the demonstration today that I will be showing you the simple things that you could be doing.
A top top is one of those pieces of software that's included with Lennox That can actually get complicated a rather quickly, but most people don't really need to worry about all those complicated tasks.
So what I'll be doing is I would simply get be giving you a very simple overview of how to use top again, to be able to go in and to be able to locate processes, to see how much resource is they're utilizing and then be able to force quit those processes if need be.
To be clear, there is a lot more to top.
But when I was looking at how to teach this particular piece of software, I think if I go too deep, that will confuse people.
And so that's no good for any of us.
So with that, let's go over to the computer on and I will show you how to use top.
And I'll show you why it is so valuable when you're trying to maintain your Lennox systems.
So here we are, back at my a bunch of server.
So I have my bun to server running with in a virtual machine on virtual box.
I'm currently using 18.4 point three.
Lt s but top should basically work on anything.
I think eso again.
Whatever distribution you're using, Top should work for you.
You will notice I have a bit smaller font than I've had in the last few videos.
And one of the reasons for this is just so I can fit everything on the screen.
When you use top, you get a lot of information and you can kind of scroll around with it using the arrow keys.
But it's kind of it's kind of difficult to teach when you have to score around too much on the screen.
So anyways, let's let's dive into this s a certain log in Bob, that password.
123456 We hit Enter and we log in.
And there we are.
Clear the screen and that from here, all you have to do is type in the top Commander T o P.
When you type in the top committee that you then get top.
And this is basically the task manager for the Lenox World.
Now the first thing we're going to see up here, we see top.
Then we see what the system time is.
So this is a system time, and then we see the up time.
So currently, this system has on Lee been been up and running for 34 minutes, eh?
So this could be useful.
Could be useful when it can be kind of interesting, especially with Lennox machines, is just to go in and literally see how long that they've been running for.
You may be shocked.
You make it a long time period up here because again, with Lennox, it's just a Web server or a basic type of server.
You can have a thing writing for a long time and not require a reboot.
This over here, says one user says, shows how many users are currently logged into the system and that is me, Bob.
Then we see this thing called Load Average This actually kind of cool, but it gets a little walkie to explain all the same time.
So basically what this is is basically this is the load average on your CPU.
This is over one minute's time period.
This is over the five minute time period, and this is over a 15 minute time period.
So this is an easy way you can go up here and you can get in a an idea of what the load on the CPU has been over a bit of a time period.
So if the CPU is currently running very fast.
At 100% you can get an idea.
OK, has this been happening for a full 15 minutes now, or is this just to spiking right now for some random reason?
So here you can look at the one minute the five minute average in the 15 minute average.
It's an important thing to understand.
Here is a full one.
So is one point.
Oh, that means 100%.
So 100% of the CPU has been utilized on average over a one minute period, and then the 0.4.
This is for the percent.
So if it says 0.40 that means 40% of the CPU on average has been utilized for one minute.
It's over here, so point, you know, 60 That would be 60% of the that.
The CPU has been utilized on average over a 15 minutes band, so you can see the one minute average in the five minute averaging 15 minute average.
I say again, this is one of those things.
Get a little bit wonky is because these numbers it's also dependent upon how many cores you have in your CPO on dso this is one of those that if, if it seems like your system is is running into resource constraints and you come up here and you see that this is one or maybe even two so it can actually show that you're trying to use too many resource is so it's trying to grab too much a CPU process.
If the numbers here are really high again, I will go into a little bit worse research on this.
Take a look at your particular system and then do all the math on this basically more or less when you're looking these numbers here, they should be significantly less than one.
If there are anywhere close to being one, go do some Google assertion and learn more about it.
Cause again there's a math with their with, with how many cores you have in your processor or some other things that to figure out what's actually going on fast that down here we see tasks.
So we have 87 total.
We have one running 48 sleeping so on so forth s so we see the percent CPU utilization.
Eso us, us is us.
That's for user's.
So how much of the CPU is being used for user's.
How much is being used for system would come down here.
We see memory, How much is free?
How much is used?
So on and so forth.
So this is some basic information up here that you could take a look at.
So again, if you see this long number here, basically, what this means is that it has a gig.
So this is in kill obits.
So this is one gig of memory that I have allocated to this system that we come down here and then we can see all of the different processes and the things going on so we can see the process i d.
The process idea is kind of like the social Security number, the number that the operating system gives two particular process.
So when we go to kill a process were actually used, that ideas that we want to kill you desperately a process we would type in 2603 And that would kill the process past that you see the user.
So currently, here we see a lot of lot of roof user.
Here we see some system MD again, we have different users in the system other than simply route and the user.
So those were there, that could be useful.
We go across, we can see CPU utilization.
We can see memory utilization time.
Plus, this is how much time that particular process has been running on.
And then we can see the actual command itself.
So these are the commands that are used to actually run the tests.
Your process is that we're seeing Here s so that's a basic overview of what you're gonna be looking at when you're looking at top as a task manager past this, uh, some simple commands, if you need help, only have to do is you type in ages.
Lower case aches gives you help, and with help, you come here.
I say, get a bit of a mess again.
I know there's man pages and help.
Paige is a Google makes life a hell of a lot of Google's pages, but this is the basic HelpAge on.
So this might be useful for you to find some basic information in order to get out of either top or the help Paige, you use lower case Q.
So get Lennox World when the problem you can run into is how the hell to get out of applications or software you've started?
Uh, that's important thing to understand.
In the top world, it is simply lower case cubes that look on your lower case.
I will be out, and now I will be looking at top now past this.
Things that weaken Dio is let's say we're looking for a process processes by a specific user, right?
So I can use the arrow keys.
So using the arrow keys, I can scroll down or I can scroll up and we see Route Moken Sea system the plus.
You see demons, we can see Bob someone so far and so one of things we can say is like Well, I don't really care about all these other system things.
I just want to see what Bob is doing What tasks, processes involved running.
So all you do is you type in a lower case you and then when you type in lower case, you and you then plug in What user?
You want to see the task force Bob just simply type and Bob that were hit enter and now we see the processes and tasks that Bob is using.
So, Bob, we can see here system and the top.
So that's what we're actually using.
We could see that CPU usage, memory usage.
We can see some of the other information.
So basically, that is how you go and you take a look at that Didn't pass that.
What we do is we can simply type that you again, President.
Er, and let's scroll down on dhe.
See, I think we have a pass.
You run the systems, we have Apache here.
So we have Apache to run him, eh?
So let's say, you know, I come in here and I simply just want to get some information on Apache to again.
Let's say install Apache.
Two things were acting a little bit weird, so I just wanna make sure pack you two is doing one supposed so that I used the o command, so I simply type o lower case.
Bos has add filter.
So what I do is uppercase command.
So what we're looking for is over here, we're gonna be searching for equals, pat fee to and then I hit enter.
And now this shows me the processes that are using the command a Paki, too, so I can see the user route user.
Www hyphen data.
I can see the CPU usage.
I can see the time I can see all this information so I can see all the processes then that are using Apache to as the command.
Now to get out of this, all I have to do is simply hit the equal sign.
Equal sign there.
Then from that one of things that I can do is I can see a parent tree so it can basically see a tree of all the different processes.
What processes are Children of other processes and order to do that?
All I have to do is I have to press uppercase V.
And so when I hit upper Case V did now shows us the parent child processes.
So we have system and D that is the parent process.
And then you have all of the Children processes that are underneath and so we can go down here and we can see all the different parent processes and the Children process is to get an idea of how the system is running.
So again, we talked about Apache to before.
So we have Apache to here and we can see that we actually have three processes called Apache to.
And so if we wanted to do something such as kill a pathway to for whatever reason, well, it was a memory leak Or is there some kind of problems going on?
And we're trying to actually have to figure out how to kill the process.
But we want to do is we want to kill the parent process.
So we have these three processes here.
If we go over, we'll see to 198 is is by route so that the route user is doing the top of the parent process.
And so if we're going to try to kill Apache to for whatever reason, we want to be killing 2198 So using V again shifty Jeff V that allows us to look at the parent Children processes.
So once we're here, the final thing to show you is basically how to kill a process so that they were gonna kill process to one dying eight directly from top.
In order to do that, we would hit Kay So lower case K and then it's asking us what process to kill.
We will plug into 198 But this is going to fail.
This is going to fail.
The reason that this is going to fail is because we went into top.
It just is a normal user.
So a normal user is able to see everything in top, but they're not able to kill.
Process is, you have to use Sue do when you use top to kill process.
If I had a dinner right now, I was just gonna get this weird error on Nothing is going to happen.
So what I'm going to do is I'm gonna hit Q.
So Q quits me out of top.
Clear and then what I'll do is I'll do Sue do top.
So this this brings us into the top software.
But it's as super user, basically as a root level user I hit Enter password 123456 Okay, so now we are end top the same thing that you saw before, but the were in as a route user.
From here, I can do decay command.
I type in 2198 because that's the P I D of Apache and then I can hit Return en er And now Apache is dead.
So if we scroll through here, we're not gonna be able to see a passion anywhere because it is no longer running If we do.
Oh, you do?
Command equals had to We're going to see that we get no results, because obviously, a pantry is no longer running hit equal again to get us back to the full screen.
And that is a basic overview of how top works as a task manager on a bun, too.
So that's a basic overview of how to use top as a task manager within the Lenox, a command line again with many things and Lennox world.
You know, top can do 1000 more things than I showed you today.
But realistically, this is what you're going to use top for.
You're gonna go in the top, you're gonna see what the hell the up time is, right.
You should go in, especially to production environment.
That up time should be a ridiculously long amount of time.
It was not ridiculously along about a time.
You need to figure out why that's rebooted in the recent past.
You're going to go when you're not looking the load average now and again.
It's important, understand, with Load average fearing out what that number actually means.
Get a little complicated between taking a look at all.
The cores in the processor was actually allocated for the server operating system the whole nine yards, but more or less remember, the number should be below one.
If the number for those three numbers is below one, then you're basically fine.
If it's above one, then you need to do a little Google, sir, if you need to do a little research to figure out what that actually means.
But when you're sitting there and looking at it on, the first number is for as the average CPU utilization over the past minute.
Then the next number is for the past five minutes, the average fast five minutes and the average for the past 15 minutes.
All of those numbers are well below one.
Then, basically, you're fine.
If it's one or above again, go do some some research, especially if you're having problems with your system past that you can see the number of tasks that are being used you can see the CPU utilization, you can see the memory utilization eso won and so forth.
But these are the basic, simple things that you will need to use again doing basic system administration and Lennox world again.
If you set up in Apache Web Server, you just want base.
Basically, make sure the Apache Web server is running, and that's not using all your CPU, and that's about it.
There's really there's really not a lot.
You're gonna be using the top in there really world and a production environment.
So I just want to show you these basic things.
If you're interested in the additional things that are available and top again, by all means do the research.