WEBVTT

00:02.200 --> 00:06.550
Weaving processes dynamically with top command.

00:07.270 --> 00:13.600
So while the PS command can reveal a lot about what the machine is doing, it provides only a snapshot

00:13.600 --> 00:14.860
of the machine state.

00:14.860 --> 00:18.160
At the moment of the command is executed.

00:19.140 --> 00:22.650
To see more dynamic views of the machine's activity.

00:22.650 --> 00:30.510
We use the top command like this here, so the top command displays a continuously updating by default

00:30.540 --> 00:36.930
every three seconds display of the system processes listed in order of process activity.

00:36.930 --> 00:44.910
So the name top comes from the fact that the top program is used to see top processes on the system.

00:44.910 --> 00:50.010
So the top display consists of two parts a system summary at the top of the display, followed by the

00:50.010 --> 00:55.170
table of processes sorted by CPU activity.

00:55.170 --> 00:59.100
So here the system summary contains a lot of good stuff.

00:59.100 --> 01:00.230
As you can see here.

01:00.240 --> 01:03.570
Let's actually understand what these are.

01:03.810 --> 01:06.180
So here we have top.

01:06.180 --> 01:13.110
So this is the name of the program here and here, as you can see here, we have actually let me get

01:13.110 --> 01:16.380
my marker here so you can see better.

01:17.090 --> 01:17.630
Here.

01:18.260 --> 01:23.810
So here, as you can see here, this is the current time of the day.

01:23.840 --> 01:26.000
This is the current time of the day.

01:26.030 --> 01:26.570
Right.

01:26.660 --> 01:29.830
And we also have the oops.

01:29.840 --> 01:30.590
Let me here.

01:30.590 --> 01:33.910
We also have the OP nine minute here.

01:33.920 --> 01:36.380
Obviously, it says this is a called op time.

01:36.380 --> 01:40.190
So it's the amount of time since the machine was last booted.

01:40.190 --> 01:45.170
So in this example, the system has been up for nine minutes.

01:45.170 --> 01:47.630
And we also have this user here.

01:47.660 --> 01:53.360
This is a there are this means that there are one logged in user.

01:53.360 --> 01:57.440
And as you can see, it's a typhoon here, which is my main user account.

01:57.440 --> 02:01.220
And we also have the load average here.

02:01.220 --> 02:02.180
Load average.

02:02.180 --> 02:09.320
This load average refers to the number of processes that are waiting to run, and that is the number

02:09.320 --> 02:14.180
of processes that are in a runnable state and sharing the CPU.

02:14.180 --> 02:15.980
So three values are shown here.

02:15.980 --> 02:18.980
So each for a different period of time.

02:18.980 --> 02:25.820
And the first is the average of the last sixth here, last 6/62.

02:25.820 --> 02:31.310
So the next here, here, this is the last 60 seconds average of last 60 seconds.

02:31.310 --> 02:35.900
The next is the previous five minutes and the finally here.

02:35.900 --> 02:41.570
So this is and 0.03 is the final of 15 minutes.

02:41.570 --> 02:46.370
So values less than 1.0 indicate that the machine is not busy here.

02:46.380 --> 02:54.110
As you can see here, my machine is not busy right now because our values is less than one in this case,

02:54.110 --> 02:57.380
0.12, 0.10 and 0.3.

02:57.380 --> 03:01.010
And as you can see, it changed to 0.10 right now.

03:02.150 --> 03:04.700
And we also have the tasks.

03:05.150 --> 03:07.300
The tasks here tasks.

03:07.310 --> 03:14.990
So this obviously says that the tasks is summarizes, summarizes the number of processes and their various

03:14.990 --> 03:16.070
process status.

03:16.070 --> 03:19.610
And we also have the CPUs.

03:19.610 --> 03:24.230
And let's actually this task, as you can see, the 192 is total.

03:24.230 --> 03:30.320
One is running 191 is sleeping zero stopped, zero zombie.

03:30.320 --> 03:34.910
And here, as you can see, these are the tasks that I use in my system.

03:34.910 --> 03:38.000
And we also have the CPU.

03:38.000 --> 03:39.710
So this is the CPU.

03:40.010 --> 03:46.760
This row describes the character of the activities that the CPU is performing here.

03:46.760 --> 03:53.180
So now I will explain what these tabs and information that the CPU tab provides us.

03:53.600 --> 04:01.820
The firstly here, as you can see here, us that written here, so the US that written here means that

04:01.920 --> 04:09.240
here in this case it's 0.6, 0.6% of the CPU is being used for user process here.

04:09.240 --> 04:13.200
As you can see, 0.5, 0.3 and so on.

04:13.200 --> 04:15.930
And we also have see here.

04:15.930 --> 04:21.270
So this is and right now is 0.8, 0.3 here.

04:21.270 --> 04:25.980
So this is the present of the CPU is being used for system kernel.

04:25.980 --> 04:27.840
So it's a kernel.

04:29.090 --> 04:29.930
Colonel.

04:31.240 --> 04:34.870
And we also have an AI here.

04:34.870 --> 04:37.120
So 0.0 an AI.

04:37.600 --> 04:45.700
So this 0.0 in this percent of the CPU is being used by nice, low priority processes.

04:45.700 --> 04:51.130
So as you learned the what's the nice and low, what's you in previous lecture actually you learned

04:51.130 --> 04:56.140
about high priority priority and low priority processes in previous lecture.

04:56.140 --> 05:04.780
So in this case it's my CPU is used, its powers 0.0% for low priority process processes.

05:04.780 --> 05:07.510
And we also have this here.

05:07.510 --> 05:14.710
In this case, it's a 97.3 ID, this is the percent of the CPU is in idle mode.

05:14.740 --> 05:19.480
Like you turn on your car and it's just an idle mode.

05:19.480 --> 05:22.390
It doesn't do or go to anywhere.

05:22.390 --> 05:30.250
And we also have one point 0VA it's now probably 0.0 and here it's going to be 1.0.

05:30.250 --> 05:34.760
So this is a present of the CPU is waiting for input output.

05:34.790 --> 05:42.410
You also learned what the input output is in previous lectures and we also have mem mem.

05:42.410 --> 05:49.040
So this is a obviously this shows how physical ram, random how physical random access memory is being

05:49.040 --> 05:50.240
used here.

05:50.240 --> 05:55.400
This is A93 thousand 914 total.

05:56.150 --> 06:00.950
2,658.93.

06:01.850 --> 06:07.430
1004 15 used and 477.

06:08.190 --> 06:10.110
Miss buffered and chats.

06:10.260 --> 06:15.060
And we also have the swap tab here, swap information here.

06:15.060 --> 06:21.570
This this swap shows how swap space or virtual memory is being used.

06:21.570 --> 06:30.300
In this case, the total swap memory is 1024, which is one gigabyte and not used here.

06:30.300 --> 06:32.430
As you can see, total is right here.

06:32.430 --> 06:34.710
And this all of them is free.

06:34.710 --> 06:39.210
So 0.0 is used right now and avail mem here.

06:39.210 --> 06:42.810
So the top program accepts a number of keyword commands.

06:42.810 --> 06:47.870
So the most interesting are the h h command here.

06:47.880 --> 06:48.930
H keyword here.

06:48.930 --> 06:54.870
Let's actually try that h here, as you can see here with h command.

06:55.880 --> 07:02.310
Uh, this display, this command displays the help screen and Q command here.

07:02.360 --> 07:06.450
Q, Q keyboard When you press the key.

07:06.660 --> 07:14.340
Q keyboard Q key in your keyboard, you will get this you will get here, as you can see here.

07:14.340 --> 07:18.750
Now, we could from the top command here and let's try it.

07:19.750 --> 07:22.000
Age again and toggle the forest view.

07:22.000 --> 07:23.740
And here we.

07:27.270 --> 07:27.600
Here.

07:27.930 --> 07:35.520
We here, as you can see here, we have several commands that we will use in next lectures here.

07:35.880 --> 07:36.690
So.

07:40.500 --> 07:41.250
And so.

07:42.520 --> 07:47.740
Uh, both major desktop environments provide graphical applications that display information similar

07:47.740 --> 07:53.830
to top in much the same way that task manager in Windows Works and the top is better than the graphical

07:53.830 --> 07:58.900
versions because it is faster and it consumes far fewer system resources.

07:58.900 --> 08:04.390
After all, our system monitor program shouldn't be the source of the system slowdown that we are trying

08:04.390 --> 08:05.260
to track.

08:05.260 --> 08:09.640
So in next lecture you will learn how to control the processes in Linux.

08:09.640 --> 08:11.470
So I'm waiting you in next lecture.
