Weaving processes dynamically with top command.
So while the PS command can reveal a lot about what the machine is doing, it provides only a snapshot
of the machine state.
At the moment of the command is executed.
To see more dynamic views of the machine's activity.
We use the top command like this here, so the top command displays a continuously updating by default
every three seconds display of the system processes listed in order of process activity.
So the name top comes from the fact that the top program is used to see top processes on the system.
So the top display consists of two parts a system summary at the top of the display, followed by the
table of processes sorted by CPU activity.
So here the system summary contains a lot of good stuff.
As you can see here.
Let's actually understand what these are.
So here we have top.
So this is the name of the program here and here, as you can see here, we have actually let me get
my marker here so you can see better.
Here.
So here, as you can see here, this is the current time of the day.
This is the current time of the day.
Right.
And we also have the oops.
Let me here.
We also have the OP nine minute here.
Obviously, it says this is a called op time.
So it's the amount of time since the machine was last booted.
So in this example, the system has been up for nine minutes.
And we also have this user here.
This is a there are this means that there are one logged in user.
And as you can see, it's a typhoon here, which is my main user account.
And we also have the load average here.
Load average.
This load average refers to the number of processes that are waiting to run, and that is the number
of processes that are in a runnable state and sharing the CPU.
So three values are shown here.
So each for a different period of time.
And the first is the average of the last sixth here, last 6/62.
So the next here, here, this is the last 60 seconds average of last 60 seconds.
The next is the previous five minutes and the finally here.
So this is and 0.03 is the final of 15 minutes.
So values less than 1.0 indicate that the machine is not busy here.
As you can see here, my machine is not busy right now because our values is less than one in this case,
0.12, 0.10 and 0.3.
And as you can see, it changed to 0.10 right now.
And we also have the tasks.
The tasks here tasks.
So this obviously says that the tasks is summarizes, summarizes the number of processes and their various
process status.
And we also have the CPUs.
And let's actually this task, as you can see, the 192 is total.
One is running 191 is sleeping zero stopped, zero zombie.
And here, as you can see, these are the tasks that I use in my system.
And we also have the CPU.
So this is the CPU.
This row describes the character of the activities that the CPU is performing here.
So now I will explain what these tabs and information that the CPU tab provides us.
The firstly here, as you can see here, us that written here, so the US that written here means that
here in this case it's 0.6, 0.6% of the CPU is being used for user process here.
As you can see, 0.5, 0.3 and so on.
And we also have see here.
So this is and right now is 0.8, 0.3 here.
So this is the present of the CPU is being used for system kernel.
So it's a kernel.
Colonel.
And we also have an AI here.
So 0.0 an AI.
So this 0.0 in this percent of the CPU is being used by nice, low priority processes.
So as you learned the what's the nice and low, what's you in previous lecture actually you learned
about high priority priority and low priority processes in previous lecture.
So in this case it's my CPU is used, its powers 0.0% for low priority process processes.
And we also have this here.
In this case, it's a 97.3 ID, this is the percent of the CPU is in idle mode.
Like you turn on your car and it's just an idle mode.
It doesn't do or go to anywhere.
And we also have one point 0VA it's now probably 0.0 and here it's going to be 1.0.
So this is a present of the CPU is waiting for input output.
You also learned what the input output is in previous lectures and we also have mem mem.
So this is a obviously this shows how physical ram, random how physical random access memory is being
used here.
This is A93 thousand 914 total.
2,658.93.
1004 15 used and 477.
Miss buffered and chats.
And we also have the swap tab here, swap information here.
This this swap shows how swap space or virtual memory is being used.
In this case, the total swap memory is 1024, which is one gigabyte and not used here.
As you can see, total is right here.
And this all of them is free.
So 0.0 is used right now and avail mem here.
So the top program accepts a number of keyword commands.
So the most interesting are the h h command here.
H keyword here.
Let's actually try that h here, as you can see here with h command.
Uh, this display, this command displays the help screen and Q command here.
Q, Q keyboard When you press the key.
Q keyboard Q key in your keyboard, you will get this you will get here, as you can see here.
Now, we could from the top command here and let's try it.
Age again and toggle the forest view.
And here we.
Here.
We here, as you can see here, we have several commands that we will use in next lectures here.
So.
And so.
Uh, both major desktop environments provide graphical applications that display information similar
to top in much the same way that task manager in Windows Works and the top is better than the graphical
versions because it is faster and it consumes far fewer system resources.
After all, our system monitor program shouldn't be the source of the system slowdown that we are trying
to track.
So in next lecture you will learn how to control the processes in Linux.
So I'm waiting you in next lecture.