- As you can hear,
my computer is a little bit noisy.
That's because it's very busy.
It has some processes that are too active.
What are you going to do if that's happening?
Well, then you are going to manage your processes
using the kill utility.
So kill is a utility
that you can use to send signals to a process
based on the PID of that process.
killall can do the same based on the process name.
And so if you have many processes with the same name
killall is more appropriate.
And if you have just one process,
then you might as well use kill to to manage it by PID.
kill can send many signals,
but the most common signals are 15 and signal 9.
15 instructs a process to stop.
And 9, also known as SIGKILL, forces a process off.
It's a little bit more brutal
but also it might be faster in some environments.
Let me show you how to kill off some processes.
All right.
Well, the thing is, if you want to manage processes
you need to know what process you need to manage.
And in this case, I can hear
that my computer is very busy because it's noisy,
but how do I find which processes are busiest?
Well, I would say go for top,
because it's the nature of top
to sort processes by busyness.
And there we can see that I have three dd processes.
Now I can kill them from top.
I don't have to go to the command line.
In top, you can use the K key.
And there we can see, it's asking PID signal to kill.
And the default PID?
Well, by default, it's taking the busiest process.
So I'm just pressing Enter.
And then it's asking, what signal do you wanna send?
I wanna send signal 15.
So there we go, signal 15.
And the process is gone.
It takes one top polling loop before you can see it,
but as you can see right now,
we only have two dd processes left.
So 6344 and 6339 are the PIDs.
So that's another way of doing it.
I can use, sudo kill 6344.
And I can also use, killall dd.
All of these are different ways of doing it.
Do notice that if you want to kill your own processes,
you can use kill.
If you want to kill somebody else's processes,
you need sudo superpowers.
As you can see, it's giving me terminated on killall dd.
And that only worked
because it was this user account who started the processes.
If you wanna know more about these signals,
type man 7 signal,
and then you will get a man page
that is explaining all the signals that are available.
It's a nice piece of reading.
And there you can get a list
of all the signals that are available.
But even if many signals are available,
the signals that are most common are signal 15 and signal 9.
Don't worry about the other ones too much.
You are probably never going to use them.