1
00:00:00,460 --> 00:00:03,460
Hello, everyone, and welcome to this video.

2
00:00:03,490 --> 00:00:11,500
So we have already seen how can we kill a process using the command kill and the process ID, which

3
00:00:11,500 --> 00:00:14,170
has been attached to that process.

4
00:00:14,560 --> 00:00:17,350
Now, let's take an example.

5
00:00:17,380 --> 00:00:24,610
If you want to kill a lot of processes that are being started by the same program, for instance, you

6
00:00:24,610 --> 00:00:33,130
have opened up multiple instance of nano, which means you are editing multiple files and immediately

7
00:00:33,130 --> 00:00:36,430
you want to kill all the processes that has been opened.

8
00:00:36,580 --> 00:00:37,870
You can also do that.

9
00:00:38,350 --> 00:00:40,930
So we are going to see how can we do that?

10
00:00:41,050 --> 00:00:43,620
So let's quickly start a process first.

11
00:00:43,630 --> 00:00:46,540
So let's type nano, x, y, z.

12
00:00:46,540 --> 00:00:51,280
And you can see we have opened up the file which is X, Y, Z.

13
00:00:51,310 --> 00:00:56,080
Let's open up one more instance of Nano using nano file two.

14
00:00:56,080 --> 00:00:58,900
And you can see we have opened to instance.

15
00:00:59,560 --> 00:01:00,250
Perfect.

16
00:01:00,280 --> 00:01:04,480
Let me open up a new terminal and let me zoom this a little bit.

17
00:01:04,810 --> 00:01:09,550
Now, as you can see, we have opened two instance of Nano.

18
00:01:09,550 --> 00:01:12,610
So it has opened new two processes.

19
00:01:12,610 --> 00:01:18,790
So let's quickly grab the process ID and here you can see this is the first process ID and this is the

20
00:01:18,790 --> 00:01:19,660
second one.

21
00:01:19,930 --> 00:01:29,110
Now if you want to kill both the nano processes, which is Nano X, Y, Z and nano file to the command

22
00:01:29,110 --> 00:01:33,760
that we are going to use is kill all and the process name.

23
00:01:33,760 --> 00:01:37,450
So the process name is nano, so kill all nano.

24
00:01:37,450 --> 00:01:43,660
And let's quickly verify if a process has been successfully killed and you can see both the process

25
00:01:43,660 --> 00:01:45,520
have been successfully killed.

26
00:01:45,550 --> 00:01:53,350
Now this method is helpful in case you want to kill processes which are been running in a very, very

27
00:01:53,350 --> 00:01:54,150
big count.

28
00:01:54,160 --> 00:01:59,860
So let's say if there are 30 or 40 instance of a specific process that has been running and you want

29
00:01:59,860 --> 00:02:07,960
to kill that you can also verify using the same command soc's grep the process name and you can see

30
00:02:07,960 --> 00:02:11,200
there is no process that is running into the background.

31
00:02:11,200 --> 00:02:18,790
Hence we can confirm that all the instance of Nano has been successfully closed or killed.

32
00:02:19,000 --> 00:02:20,720
I hope you guys understood this.

33
00:02:20,740 --> 00:02:21,550
Thank you.
