Thanks Jay, a nice level of detail for a command I have only ever used in its raw form of just “kill”. Linux is such a rich operating system you just never stop learning new things.
I was sad to see that we start the discussion with -9. The default used by kill is 15 (SIGTERM) which basically is sent to the target process indicating that it should terminate. This allows it to GRACEFULLY organize it's own termination. Closing open file handles, deallocating memory, closing ports, or really whatever it needs to do to smoothly shutdown. Conversely, -9 simply wipes the process from the system. By not performing a graceful termination, things can be left in an uncertain state. During the runtime of the machine, as the kernel interacts with these leftovers, it'll figure out that there's not a process associated with the resource any longer and reconcile it. But it takes compute time to do so and if the process had something in memory that it had not yet written to disk, for example, that data is going to be lost forever. There are, of course, times when you need to use -9 (SIGKILL) because the process is not able to process the terminate or maybe someone has written the program to ignore SIGTERM, but in my experience, those times are few. One should always try to kill -15 (or no options as 15 is the default) a process, then provide some time for the process to gracefully terminate, before using kill -9. As a programmer, you can write signal handling into your application, for example, the dd command will print a status when it receives SIGUSR1 (10). If you'd like to see that in action: dd if=/dev/zero of=/dev/null & (this will run a dd process in the background on your terminal, as part of the invocation it'll tell you the process ID number of the process) kill -10 Because this process is running in the background, to then terminate it, kill -Your Friendly Neighborhood RHEL Red Hatter.
Does it (i mean the default -15 flag) return different values on whether the process was killed or not? Or should we check it in an if atatement after?
No. 1 Linux course on TH-cam & I think nobody can teach better than you who are selling their courses. Thanks very much Jay for your contributions.
I love these tutorials, thanks, Jay! Loved the Klingon description :)
Thanks Jay, a nice level of detail for a command I have only ever used in its raw form of just “kill”. Linux is such a rich operating system you just never stop learning new things.
Great tutorial, Jay. I appreciate the effort.
I was sad to see that we start the discussion with -9. The default used by kill is 15 (SIGTERM) which basically is sent to the target process indicating that it should terminate. This allows it to GRACEFULLY organize it's own termination. Closing open file handles, deallocating memory, closing ports, or really whatever it needs to do to smoothly shutdown.
Conversely, -9 simply wipes the process from the system. By not performing a graceful termination, things can be left in an uncertain state. During the runtime of the machine, as the kernel interacts with these leftovers, it'll figure out that there's not a process associated with the resource any longer and reconcile it. But it takes compute time to do so and if the process had something in memory that it had not yet written to disk, for example, that data is going to be lost forever.
There are, of course, times when you need to use -9 (SIGKILL) because the process is not able to process the terminate or maybe someone has written the program to ignore SIGTERM, but in my experience, those times are few. One should always try to kill -15 (or no options as 15 is the default) a process, then provide some time for the process to gracefully terminate, before using kill -9.
As a programmer, you can write signal handling into your application, for example, the dd command will print a status when it receives SIGUSR1 (10). If you'd like to see that in action:
dd if=/dev/zero of=/dev/null &
(this will run a dd process in the background on your terminal, as part of the invocation it'll tell you the process ID number of the process)
kill -10
Because this process is running in the background, to then terminate it, kill
-Your Friendly Neighborhood RHEL Red Hatter.
very useful especially pidof
Glad I clicked! Thanks!
Not a bot, but I love Linux
It sad people have say they are not a bot
I always learn something useful! Many thanks! 🍷🍷
That green glow looks awesome, is that some kind of theme of your window manager? Or is that just edited into the video?
1:05 🖖
Thank you for your video 🤩
You can also do kill -s HUP without the sig prefix.
great video!
i have a question though; what launcher did you use in your video? was it ulauncher?
Looks like the Pop!_OS launcher
Does it (i mean the default -15 flag) return different values on whether the process was killed or not? Or should we check it in an if atatement after?
on my server logrotate is sending -HUP signal to rsyslog PID when rotating logs
boa tarde amigo
pode fazer video install libtorrent/1.2.2.0 in linux.
thanks
10:00 why creating content like this is not cheap? They are simple tutorial videos
I'm afraid to type the k word in the comments because yt will most likely shadow b me
!!!