1 00:00:00,680 --> 00:00:01,690 Hello everyone. 2 00:00:01,700 --> 00:00:08,200 In this demo I'm going to talk about the processes signals in Linux operating systems. 3 00:00:08,210 --> 00:00:14,990 We can use signals in order to interact and deal with processes or programs. 4 00:00:15,690 --> 00:00:22,980 Sometimes there are some processes that we need to interrupt them because they might be freezing or 5 00:00:22,980 --> 00:00:28,410 not working or creating some problems for CPU memory and so on. 6 00:00:29,240 --> 00:00:34,490 If I would like to print a list of signal names, I can run the command kill space. 7 00:00:34,490 --> 00:00:37,060 Dash l hit enter. 8 00:00:37,070 --> 00:00:38,960 As you can see here on the screen. 9 00:00:38,990 --> 00:00:41,690 Here is a list of signal names. 10 00:00:42,310 --> 00:00:48,010 For example, we have the signal hang up is to hang up a signal on controlling terminal. 11 00:00:48,010 --> 00:00:49,450 And we have number two here. 12 00:00:49,450 --> 00:00:53,200 The signal in it is to send an interrupt signal. 13 00:00:53,200 --> 00:00:59,290 And we have the signal quit is to send a quit signal. 14 00:00:59,290 --> 00:01:04,930 And here is the most common signal that we use in Linux. 15 00:01:04,930 --> 00:01:10,660 The signal kill, if I would like to kill and terminate the process. 16 00:01:10,660 --> 00:01:18,010 And also we have here number 15 here, the signal term number 15 is a software termination signal. 17 00:01:18,010 --> 00:01:23,410 And we have the signal stop is if I would like to stop the process. 18 00:01:24,440 --> 00:01:32,330 Now, if I would like to list the process ID of a specific process, I run the Pgrep command. 19 00:01:32,360 --> 00:01:33,980 So, for example. 20 00:01:35,100 --> 00:01:35,880 Here. 21 00:01:36,210 --> 00:01:46,770 I'm going just to I opened the Firefox over here, so I would like to get the process ID for the Firefox. 22 00:01:46,770 --> 00:01:56,490 So what I'm going to do, I'm going to run the command P grep, then Firefox browser and hit enter. 23 00:01:56,580 --> 00:02:00,270 As we can see here, this is the process ID. 24 00:02:01,750 --> 00:02:04,630 Now if I would like to stop the process. 25 00:02:06,030 --> 00:02:11,430 I can run the command, but before I'm going to run, so I can, as we can see here, I can open any 26 00:02:11,430 --> 00:02:12,150 page. 27 00:02:14,970 --> 00:02:21,510 But if I would like to stop the process and I cannot use the Firefox browser anymore so I can run the 28 00:02:21,510 --> 00:02:25,630 command just clear here. 29 00:02:25,650 --> 00:02:28,890 So I'm going to run the command kill. 30 00:02:30,440 --> 00:02:30,920 Before. 31 00:02:30,920 --> 00:02:34,130 I'm going to kill them just to show you. 32 00:02:34,130 --> 00:02:36,380 So I'm going to use this signal. 33 00:02:36,380 --> 00:02:42,740 So kill then dash s I g signal stop. 34 00:02:44,000 --> 00:02:48,770 Then the process ID for Firefox. 35 00:02:48,770 --> 00:02:49,700 It's this one. 36 00:02:49,700 --> 00:02:51,110 It's four nine. 37 00:02:52,190 --> 00:02:54,020 4980. 38 00:02:54,170 --> 00:02:55,250 I hit enter. 39 00:02:56,480 --> 00:02:59,960 Then I can go over here, try to open anything. 40 00:02:59,960 --> 00:03:00,460 I can't. 41 00:03:00,470 --> 00:03:03,110 I cannot use the browser anymore. 42 00:03:03,320 --> 00:03:04,430 I cannot close it. 43 00:03:04,430 --> 00:03:04,970 I cannot. 44 00:03:04,970 --> 00:03:07,640 I cannot open another tab. 45 00:03:07,640 --> 00:03:08,480 Nothing. 46 00:03:08,510 --> 00:03:12,290 And it's going to give me a message that is not working or is freezing. 47 00:03:12,320 --> 00:03:22,460 But if I would like to kill the Firefox and I would like to kill the process, there's two ways I can 48 00:03:22,460 --> 00:03:23,150 do it. 49 00:03:23,480 --> 00:03:34,070 If I would like to kill the the process with with the ID, for example, I can run the command kill, 50 00:03:34,100 --> 00:03:39,740 then dash nine, then I'm going to add the process ID here. 51 00:03:39,740 --> 00:03:41,840 But there is another command here. 52 00:03:41,840 --> 00:03:47,780 If I would like to kill or terminate the process based on the name, I can run the command P kill. 53 00:03:49,720 --> 00:03:51,630 Then dash nine. 54 00:03:51,720 --> 00:03:52,560 Dash nine. 55 00:03:52,560 --> 00:03:53,730 Here is the short. 56 00:03:54,420 --> 00:04:00,360 I can't type the signal kill or I can type the dash nine. 57 00:04:00,360 --> 00:04:01,920 So I have the options. 58 00:04:01,920 --> 00:04:02,700 The dash. 59 00:04:02,700 --> 00:04:11,490 Either I can type the name or the number of the signal, then space fire, Fox. 60 00:04:11,700 --> 00:04:21,420 Then if I'm going to hit enter the the system or is going to force or is going to close the Firefox, 61 00:04:21,420 --> 00:04:25,620 I'm going to hit enter and it's going to terminate the process of the Firefox. 62 00:04:26,070 --> 00:04:33,300 As we can see here, we don't have the Firefox browser anymore because I terminate and I killed the 63 00:04:33,300 --> 00:04:35,580 process of Firefox. 64 00:04:35,850 --> 00:04:42,510 If I would like to find more information about the kill command, I can go to the page and we can find 65 00:04:42,510 --> 00:04:46,200 more information and details about this command. 66 00:04:46,200 --> 00:04:50,340 And also the same thing for P kill command. 67 00:04:50,400 --> 00:05:00,600 As you can see here, the p grip, the same thing with same thing is the same same command like the 68 00:05:00,600 --> 00:05:06,210 P kill also looks it looks up or a signal process based on a name or other attributes. 69 00:05:06,960 --> 00:05:08,550 Thus concludes our session. 70 00:05:08,550 --> 00:05:10,650 Thank you and see you in the next lesson.