Hello everyone and welcome to this
video. So we have already seen how
can we kill a process using the
command kill and the process ID which has
been attached to that process?
Now, let's take an example. If you
want to kill a lot of processes that are
being started by the same program. For instance.
You have opened up multiple instance
of Nano, which means you are editing
multiple files and
Immediately you want to kill all the processes that has been opened.
You can also do that.
So we are going to see how can we do that? So let's quickly
start a process first. So let's type
Nano XYZ and you can see we have
opened up the file, which is x y
z. Let's open up one more instance of Nano
using Nano file to and you
can see we have opened to instance.
Perfect. Let me open up a new terminal and let me
Zoom this a little bit.
Now as you can see, we have opened two
instance of Nano. So it has opened new
two processes. So let's quickly grab
the process ID and here you can see this is
the first process ID and this is the second one.
now if you want to kill both the
nanoprocesses, which is nano XYZ and
Nano file to
the command that we are going to use is kill all and
the process name. So the process
name is nano. So kill all Nano and let's
quickly verify if our processes has been successfully
killed and you can see both the process have
been successfully killed. Now. This method is
helpful in case you want to kill processes
which are being running in a
very very big town. So let's say there are 30 or
40 instance of a specific process that
has been running anyone to kill that.
You can also verify using the same command PS aux
grip the process name and you
can see there is no process that is running into the background,
hence. We can confirm that all the
instance of Nano has been successfully closed
or killed. I hope you
guys understood this. Thank you.