1
00:00:02,200 --> 00:00:06,550
Weaving processes dynamically with top command.

2
00:00:07,270 --> 00:00:13,600
So while the PS command can reveal a lot about what the machine is doing, it provides only a snapshot

3
00:00:13,600 --> 00:00:14,860
of the machine state.

4
00:00:14,860 --> 00:00:18,160
At the moment of the command is executed.

5
00:00:19,140 --> 00:00:22,650
To see more dynamic views of the machine's activity.

6
00:00:22,650 --> 00:00:30,510
We use the top command like this here, so the top command displays a continuously updating by default

7
00:00:30,540 --> 00:00:36,930
every three seconds display of the system processes listed in order of process activity.

8
00:00:36,930 --> 00:00:44,910
So the name top comes from the fact that the top program is used to see top processes on the system.

9
00:00:44,910 --> 00:00:50,010
So the top display consists of two parts a system summary at the top of the display, followed by the

10
00:00:50,010 --> 00:00:55,170
table of processes sorted by CPU activity.

11
00:00:55,170 --> 00:00:59,100
So here the system summary contains a lot of good stuff.

12
00:00:59,100 --> 00:01:00,230
As you can see here.

13
00:01:00,240 --> 00:01:03,570
Let's actually understand what these are.

14
00:01:03,810 --> 00:01:06,180
So here we have top.

15
00:01:06,180 --> 00: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

16
00:01:13,110 --> 00:01:16,380
my marker here so you can see better.

17
00:01:17,090 --> 00:01:17,630
Here.

18
00:01:18,260 --> 00:01:23,810
So here, as you can see here, this is the current time of the day.

19
00:01:23,840 --> 00:01:26,000
This is the current time of the day.

20
00:01:26,030 --> 00:01:26,570
Right.

21
00:01:26,660 --> 00:01:29,830
And we also have the oops.

22
00:01:29,840 --> 00:01:30,590
Let me here.

23
00:01:30,590 --> 00:01:33,910
We also have the OP nine minute here.

24
00:01:33,920 --> 00:01:36,380
Obviously, it says this is a called op time.

25
00:01:36,380 --> 00:01:40,190
So it's the amount of time since the machine was last booted.

26
00:01:40,190 --> 00:01:45,170
So in this example, the system has been up for nine minutes.

27
00:01:45,170 --> 00:01:47,630
And we also have this user here.

28
00:01:47,660 --> 00:01:53,360
This is a there are this means that there are one logged in user.

29
00:01:53,360 --> 00:01:57,440
And as you can see, it's a typhoon here, which is my main user account.

30
00:01:57,440 --> 00:02:01,220
And we also have the load average here.

31
00:02:01,220 --> 00:02:02,180
Load average.

32
00:02:02,180 --> 00:02:09,320
This load average refers to the number of processes that are waiting to run, and that is the number

33
00:02:09,320 --> 00:02:14,180
of processes that are in a runnable state and sharing the CPU.

34
00:02:14,180 --> 00:02:15,980
So three values are shown here.

35
00:02:15,980 --> 00:02:18,980
So each for a different period of time.

36
00:02:18,980 --> 00:02:25,820
And the first is the average of the last sixth here, last 6/62.

37
00:02:25,820 --> 00:02:31,310
So the next here, here, this is the last 60 seconds average of last 60 seconds.

38
00:02:31,310 --> 00:02:35,900
The next is the previous five minutes and the finally here.

39
00:02:35,900 --> 00:02:41,570
So this is and 0.03 is the final of 15 minutes.

40
00:02:41,570 --> 00:02:46,370
So values less than 1.0 indicate that the machine is not busy here.

41
00:02:46,380 --> 00: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,

42
00:02:54,110 --> 00:02:57,380
0.12, 0.10 and 0.3.

43
00:02:57,380 --> 00:03:01,010
And as you can see, it changed to 0.10 right now.

44
00:03:02,150 --> 00:03:04,700
And we also have the tasks.

45
00:03:05,150 --> 00:03:07,300
The tasks here tasks.

46
00:03:07,310 --> 00:03:14,990
So this obviously says that the tasks is summarizes, summarizes the number of processes and their various

47
00:03:14,990 --> 00:03:16,070
process status.

48
00:03:16,070 --> 00:03:19,610
And we also have the CPUs.

49
00:03:19,610 --> 00:03:24,230
And let's actually this task, as you can see, the 192 is total.

50
00:03:24,230 --> 00:03:30,320
One is running 191 is sleeping zero stopped, zero zombie.

51
00:03:30,320 --> 00:03:34,910
And here, as you can see, these are the tasks that I use in my system.

52
00:03:34,910 --> 00:03:38,000
And we also have the CPU.

53
00:03:38,000 --> 00:03:39,710
So this is the CPU.

54
00:03:40,010 --> 00:03:46,760
This row describes the character of the activities that the CPU is performing here.

55
00:03:46,760 --> 00:03:53,180
So now I will explain what these tabs and information that the CPU tab provides us.

56
00:03:53,600 --> 00:04:01,820
The firstly here, as you can see here, us that written here, so the US that written here means that

57
00:04:01,920 --> 00:04:09,240
here in this case it's 0.6, 0.6% of the CPU is being used for user process here.

58
00:04:09,240 --> 00:04:13,200
As you can see, 0.5, 0.3 and so on.

59
00:04:13,200 --> 00:04:15,930
And we also have see here.

60
00:04:15,930 --> 00:04:21,270
So this is and right now is 0.8, 0.3 here.

61
00:04:21,270 --> 00:04:25,980
So this is the present of the CPU is being used for system kernel.

62
00:04:25,980 --> 00:04:27,840
So it's a kernel.

63
00:04:29,090 --> 00:04:29,930
Colonel.

64
00:04:31,240 --> 00:04:34,870
And we also have an AI here.

65
00:04:34,870 --> 00:04:37,120
So 0.0 an AI.

66
00:04:37,600 --> 00:04:45,700
So this 0.0 in this percent of the CPU is being used by nice, low priority processes.

67
00:04:45,700 --> 00:04:51,130
So as you learned the what's the nice and low, what's you in previous lecture actually you learned

68
00:04:51,130 --> 00:04:56,140
about high priority priority and low priority processes in previous lecture.

69
00:04:56,140 --> 00:05:04,780
So in this case it's my CPU is used, its powers 0.0% for low priority process processes.

70
00:05:04,780 --> 00:05:07,510
And we also have this here.

71
00:05:07,510 --> 00:05:14,710
In this case, it's a 97.3 ID, this is the percent of the CPU is in idle mode.

72
00:05:14,740 --> 00:05:19,480
Like you turn on your car and it's just an idle mode.

73
00:05:19,480 --> 00:05:22,390
It doesn't do or go to anywhere.

74
00:05:22,390 --> 00: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.

75
00:05:30,250 --> 00:05:34,760
So this is a present of the CPU is waiting for input output.

76
00:05:34,790 --> 00:05:42,410
You also learned what the input output is in previous lectures and we also have mem mem.

77
00:05:42,410 --> 00:05:49,040
So this is a obviously this shows how physical ram, random how physical random access memory is being

78
00:05:49,040 --> 00:05:50,240
used here.

79
00:05:50,240 --> 00:05:55,400
This is A93 thousand 914 total.

80
00:05:56,150 --> 00:06:00,950
2,658.93.

81
00:06:01,850 --> 00:06:07,430
1004 15 used and 477.

82
00:06:08,190 --> 00:06:10,110
Miss buffered and chats.

83
00:06:10,260 --> 00:06:15,060
And we also have the swap tab here, swap information here.

84
00:06:15,060 --> 00:06:21,570
This this swap shows how swap space or virtual memory is being used.

85
00:06:21,570 --> 00:06:30,300
In this case, the total swap memory is 1024, which is one gigabyte and not used here.

86
00:06:30,300 --> 00:06:32,430
As you can see, total is right here.

87
00:06:32,430 --> 00:06:34,710
And this all of them is free.

88
00:06:34,710 --> 00:06:39,210
So 0.0 is used right now and avail mem here.

89
00:06:39,210 --> 00:06:42,810
So the top program accepts a number of keyword commands.

90
00:06:42,810 --> 00:06:47,870
So the most interesting are the h h command here.

91
00:06:47,880 --> 00:06:48,930
H keyword here.

92
00:06:48,930 --> 00:06:54,870
Let's actually try that h here, as you can see here with h command.

93
00:06:55,880 --> 00:07:02,310
Uh, this display, this command displays the help screen and Q command here.

94
00:07:02,360 --> 00:07:06,450
Q, Q keyboard When you press the key.

95
00:07:06,660 --> 00:07:14,340
Q keyboard Q key in your keyboard, you will get this you will get here, as you can see here.

96
00:07:14,340 --> 00:07:18,750
Now, we could from the top command here and let's try it.

97
00:07:19,750 --> 00:07:22,000
Age again and toggle the forest view.

98
00:07:22,000 --> 00:07:23,740
And here we.

99
00:07:27,270 --> 00:07:27,600
Here.

100
00:07:27,930 --> 00:07:35,520
We here, as you can see here, we have several commands that we will use in next lectures here.

101
00:07:35,880 --> 00:07:36,690
So.

102
00:07:40,500 --> 00:07:41,250
And so.

103
00:07:42,520 --> 00:07:47,740
Uh, both major desktop environments provide graphical applications that display information similar

104
00:07:47,740 --> 00:07:53,830
to top in much the same way that task manager in Windows Works and the top is better than the graphical

105
00:07:53,830 --> 00:07:58,900
versions because it is faster and it consumes far fewer system resources.

106
00:07:58,900 --> 00:08:04,390
After all, our system monitor program shouldn't be the source of the system slowdown that we are trying

107
00:08:04,390 --> 00:08:05,260
to track.

108
00:08:05,260 --> 00:08:09,640
So in next lecture you will learn how to control the processes in Linux.

109
00:08:09,640 --> 00:08:11,470
So I'm waiting you in next lecture.
