Hello everyone.
In this demo I'm going to talk about the processes signals in Linux operating systems.
We can use signals in order to interact and deal with processes or programs.
Sometimes there are some processes that we need to interrupt them because they might be freezing or
not working or creating some problems for CPU memory and so on.
If I would like to print a list of signal names, I can run the command kill space.
Dash l hit enter.
As you can see here on the screen.
Here is a list of signal names.
For example, we have the signal hang up is to hang up a signal on controlling terminal.
And we have number two here.
The signal in it is to send an interrupt signal.
And we have the signal quit is to send a quit signal.
And here is the most common signal that we use in Linux.
The signal kill, if I would like to kill and terminate the process.
And also we have here number 15 here, the signal term number 15 is a software termination signal.
And we have the signal stop is if I would like to stop the process.
Now, if I would like to list the process ID of a specific process, I run the Pgrep command.
So, for example.
Here.
I'm going just to I opened the Firefox over here, so I would like to get the process ID for the Firefox.
So what I'm going to do, I'm going to run the command P grep, then Firefox browser and hit enter.
As we can see here, this is the process ID.
Now if I would like to stop the process.
I can run the command, but before I'm going to run, so I can, as we can see here, I can open any
page.
But if I would like to stop the process and I cannot use the Firefox browser anymore so I can run the
command just clear here.
So I'm going to run the command kill.
Before.
I'm going to kill them just to show you.
So I'm going to use this signal.
So kill then dash s I g signal stop.
Then the process ID for Firefox.
It's this one.
It's four nine.
4980.
I hit enter.
Then I can go over here, try to open anything.
I can't.
I cannot use the browser anymore.
I cannot close it.
I cannot.
I cannot open another tab.
Nothing.
And it's going to give me a message that is not working or is freezing.
But if I would like to kill the Firefox and I would like to kill the process, there's two ways I can
do it.
If I would like to kill the the process with with the ID, for example, I can run the command kill,
then dash nine, then I'm going to add the process ID here.
But there is another command here.
If I would like to kill or terminate the process based on the name, I can run the command P kill.
Then dash nine.
Dash nine.
Here is the short.
I can't type the signal kill or I can type the dash nine.
So I have the options.
The dash.
Either I can type the name or the number of the signal, then space fire, Fox.
Then if I'm going to hit enter the the system or is going to force or is going to close the Firefox,
I'm going to hit enter and it's going to terminate the process of the Firefox.
As we can see here, we don't have the Firefox browser anymore because I terminate and I killed the
process of Firefox.
If I would like to find more information about the kill command, I can go to the page and we can find
more information and details about this command.
And also the same thing for P kill command.
As you can see here, the p grip, the same thing with same thing is the same same command like the
P kill also looks it looks up or a signal process based on a name or other attributes.
Thus concludes our session.
Thank you and see you in the next lesson.