1 00:00:06,840 --> 00:00:07,770 - As you can hear, 2 00:00:07,770 --> 00:00:09,780 my computer is a little bit noisy. 3 00:00:09,780 --> 00:00:11,730 That's because it's very busy. 4 00:00:11,730 --> 00:00:14,520 It has some processes that are too active. 5 00:00:14,520 --> 00:00:16,620 What are you going to do if that's happening? 6 00:00:16,620 --> 00:00:19,050 Well, then you are going to manage your processes 7 00:00:19,050 --> 00:00:20,973 using the kill utility. 8 00:00:22,170 --> 00:00:23,970 So kill is a utility 9 00:00:23,970 --> 00:00:26,490 that you can use to send signals to a process 10 00:00:26,490 --> 00:00:29,243 based on the PID of that process. 11 00:00:29,243 --> 00:00:32,760 killall can do the same based on the process name. 12 00:00:32,760 --> 00:00:35,100 And so if you have many processes with the same name 13 00:00:35,100 --> 00:00:36,810 killall is more appropriate. 14 00:00:36,810 --> 00:00:39,360 And if you have just one process, 15 00:00:39,360 --> 00:00:44,070 then you might as well use kill to to manage it by PID. 16 00:00:44,070 --> 00:00:45,647 kill can send many signals, 17 00:00:45,647 --> 00:00:49,383 but the most common signals are 15 and signal 9. 18 00:00:50,340 --> 00:00:52,830 15 instructs a process to stop. 19 00:00:52,830 --> 00:00:56,970 And 9, also known as SIGKILL, forces a process off. 20 00:00:56,970 --> 00:00:58,860 It's a little bit more brutal 21 00:00:58,860 --> 00:01:02,523 but also it might be faster in some environments. 22 00:01:03,420 --> 00:01:06,003 Let me show you how to kill off some processes. 23 00:01:08,250 --> 00:01:09,083 All right. 24 00:01:09,083 --> 00:01:11,070 Well, the thing is, if you want to manage processes 25 00:01:11,070 --> 00:01:15,330 you need to know what process you need to manage. 26 00:01:15,330 --> 00:01:17,190 And in this case, I can hear 27 00:01:17,190 --> 00:01:20,220 that my computer is very busy because it's noisy, 28 00:01:20,220 --> 00:01:24,990 but how do I find which processes are busiest? 29 00:01:24,990 --> 00:01:26,820 Well, I would say go for top, 30 00:01:26,820 --> 00:01:28,620 because it's the nature of top 31 00:01:28,620 --> 00:01:30,900 to sort processes by busyness. 32 00:01:30,900 --> 00:01:34,560 And there we can see that I have three dd processes. 33 00:01:34,560 --> 00:01:37,830 Now I can kill them from top. 34 00:01:37,830 --> 00:01:39,630 I don't have to go to the command line. 35 00:01:39,630 --> 00:01:41,880 In top, you can use the K key. 36 00:01:41,880 --> 00:01:45,240 And there we can see, it's asking PID signal to kill. 37 00:01:45,240 --> 00:01:46,590 And the default PID? 38 00:01:46,590 --> 00:01:49,530 Well, by default, it's taking the busiest process. 39 00:01:49,530 --> 00:01:50,910 So I'm just pressing Enter. 40 00:01:50,910 --> 00:01:53,550 And then it's asking, what signal do you wanna send? 41 00:01:53,550 --> 00:01:55,290 I wanna send signal 15. 42 00:01:55,290 --> 00:01:57,360 So there we go, signal 15. 43 00:01:57,360 --> 00:01:59,100 And the process is gone. 44 00:01:59,100 --> 00:02:01,920 It takes one top polling loop before you can see it, 45 00:02:01,920 --> 00:02:03,270 but as you can see right now, 46 00:02:03,270 --> 00:02:06,720 we only have two dd processes left. 47 00:02:06,720 --> 00:02:11,283 So 6344 and 6339 are the PIDs. 48 00:02:12,420 --> 00:02:14,310 So that's another way of doing it. 49 00:02:14,310 --> 00:02:19,310 I can use, sudo kill 6344. 50 00:02:19,950 --> 00:02:23,370 And I can also use, killall dd. 51 00:02:23,370 --> 00:02:26,820 All of these are different ways of doing it. 52 00:02:26,820 --> 00:02:30,150 Do notice that if you want to kill your own processes, 53 00:02:30,150 --> 00:02:31,230 you can use kill. 54 00:02:31,230 --> 00:02:34,170 If you want to kill somebody else's processes, 55 00:02:34,170 --> 00:02:36,660 you need sudo superpowers. 56 00:02:36,660 --> 00:02:41,040 As you can see, it's giving me terminated on killall dd. 57 00:02:41,040 --> 00:02:42,510 And that only worked 58 00:02:42,510 --> 00:02:46,800 because it was this user account who started the processes. 59 00:02:46,800 --> 00:02:49,590 If you wanna know more about these signals, 60 00:02:49,590 --> 00:02:52,410 type man 7 signal, 61 00:02:52,410 --> 00:02:54,270 and then you will get a man page 62 00:02:54,270 --> 00:02:57,780 that is explaining all the signals that are available. 63 00:02:57,780 --> 00:02:59,910 It's a nice piece of reading. 64 00:02:59,910 --> 00:03:01,350 And there you can get a list 65 00:03:01,350 --> 00:03:03,930 of all the signals that are available. 66 00:03:03,930 --> 00:03:06,600 But even if many signals are available, 67 00:03:06,600 --> 00:03:10,980 the signals that are most common are signal 15 and signal 9. 68 00:03:10,980 --> 00:03:13,290 Don't worry about the other ones too much. 69 00:03:13,290 --> 00:03:15,513 You are probably never going to use them.