Difference between `kill -9 ` and `kill -INT `?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
5
down vote

favorite
1












I cannot figure out what the difference is between



kill -9 <pid>



and



kill -INT <pid>



can anyone explain it to me like I am 3 years old?







share|improve this question


















  • 2




    kill -INT $pid is like sticking a rod through pid to see what happens. Maybe it'll die, maybe it won't. kill -9 $pid will kill pid with fire and it absolutely will not stop until pid is dead.
    – PSkocik
    Oct 20 '17 at 21:19










  • lol that will def help a 3 year old understand :)
    – Alexander Mills
    Oct 20 '17 at 21:47










  • @PSkocik, Hilarious. Like a fairy tale fable about the kill command. Love it!
    – RobertL
    Oct 23 '17 at 20:50










  • Can -9 also be represent by a "string", such as kill -KILL or something?
    – Alexander Mills
    Oct 23 '17 at 21:33






  • 1




    @AlexanderMills yes, see "Advanced Concepts" in the answer below.
    – RobertL
    Oct 26 '17 at 3:38















up vote
5
down vote

favorite
1












I cannot figure out what the difference is between



kill -9 <pid>



and



kill -INT <pid>



can anyone explain it to me like I am 3 years old?







share|improve this question


















  • 2




    kill -INT $pid is like sticking a rod through pid to see what happens. Maybe it'll die, maybe it won't. kill -9 $pid will kill pid with fire and it absolutely will not stop until pid is dead.
    – PSkocik
    Oct 20 '17 at 21:19










  • lol that will def help a 3 year old understand :)
    – Alexander Mills
    Oct 20 '17 at 21:47










  • @PSkocik, Hilarious. Like a fairy tale fable about the kill command. Love it!
    – RobertL
    Oct 23 '17 at 20:50










  • Can -9 also be represent by a "string", such as kill -KILL or something?
    – Alexander Mills
    Oct 23 '17 at 21:33






  • 1




    @AlexanderMills yes, see "Advanced Concepts" in the answer below.
    – RobertL
    Oct 26 '17 at 3:38













up vote
5
down vote

favorite
1









up vote
5
down vote

favorite
1






1





I cannot figure out what the difference is between



kill -9 <pid>



and



kill -INT <pid>



can anyone explain it to me like I am 3 years old?







share|improve this question














I cannot figure out what the difference is between



kill -9 <pid>



and



kill -INT <pid>



can anyone explain it to me like I am 3 years old?









share|improve this question













share|improve this question




share|improve this question








edited Oct 20 '17 at 21:16









Jeff Schaller

32.1k849109




32.1k849109










asked Oct 20 '17 at 21:09









Alexander Mills

1,9441029




1,9441029







  • 2




    kill -INT $pid is like sticking a rod through pid to see what happens. Maybe it'll die, maybe it won't. kill -9 $pid will kill pid with fire and it absolutely will not stop until pid is dead.
    – PSkocik
    Oct 20 '17 at 21:19










  • lol that will def help a 3 year old understand :)
    – Alexander Mills
    Oct 20 '17 at 21:47










  • @PSkocik, Hilarious. Like a fairy tale fable about the kill command. Love it!
    – RobertL
    Oct 23 '17 at 20:50










  • Can -9 also be represent by a "string", such as kill -KILL or something?
    – Alexander Mills
    Oct 23 '17 at 21:33






  • 1




    @AlexanderMills yes, see "Advanced Concepts" in the answer below.
    – RobertL
    Oct 26 '17 at 3:38













  • 2




    kill -INT $pid is like sticking a rod through pid to see what happens. Maybe it'll die, maybe it won't. kill -9 $pid will kill pid with fire and it absolutely will not stop until pid is dead.
    – PSkocik
    Oct 20 '17 at 21:19










  • lol that will def help a 3 year old understand :)
    – Alexander Mills
    Oct 20 '17 at 21:47










  • @PSkocik, Hilarious. Like a fairy tale fable about the kill command. Love it!
    – RobertL
    Oct 23 '17 at 20:50










  • Can -9 also be represent by a "string", such as kill -KILL or something?
    – Alexander Mills
    Oct 23 '17 at 21:33






  • 1




    @AlexanderMills yes, see "Advanced Concepts" in the answer below.
    – RobertL
    Oct 26 '17 at 3:38








2




2




kill -INT $pid is like sticking a rod through pid to see what happens. Maybe it'll die, maybe it won't. kill -9 $pid will kill pid with fire and it absolutely will not stop until pid is dead.
– PSkocik
Oct 20 '17 at 21:19




kill -INT $pid is like sticking a rod through pid to see what happens. Maybe it'll die, maybe it won't. kill -9 $pid will kill pid with fire and it absolutely will not stop until pid is dead.
– PSkocik
Oct 20 '17 at 21:19












lol that will def help a 3 year old understand :)
– Alexander Mills
Oct 20 '17 at 21:47




lol that will def help a 3 year old understand :)
– Alexander Mills
Oct 20 '17 at 21:47












@PSkocik, Hilarious. Like a fairy tale fable about the kill command. Love it!
– RobertL
Oct 23 '17 at 20:50




@PSkocik, Hilarious. Like a fairy tale fable about the kill command. Love it!
– RobertL
Oct 23 '17 at 20:50












Can -9 also be represent by a "string", such as kill -KILL or something?
– Alexander Mills
Oct 23 '17 at 21:33




Can -9 also be represent by a "string", such as kill -KILL or something?
– Alexander Mills
Oct 23 '17 at 21:33




1




1




@AlexanderMills yes, see "Advanced Concepts" in the answer below.
– RobertL
Oct 26 '17 at 3:38





@AlexanderMills yes, see "Advanced Concepts" in the answer below.
– RobertL
Oct 26 '17 at 3:38











1 Answer
1






active

oldest

votes

















up vote
8
down vote



accepted










kill -INT $pid sends the "interrupt" signal to the process with process ID pid. However, the process may decide to ignore the signal, or catch the signal and do something before exiting and/or ignore it.



kill -9 $pid sends the "kill" signal which cannot be caught or ignored. The process will be forcibly shut down with no notification to the process, and no chance to do any cleanup what so ever. kill -9 $pid should almost never be recommended or used, though sometimes it's necessary.



Advanced Concepts



kill -INT $pid is the same as kill -2 $pid.
kill -9 $pid is the same as kill -KILL $pid



There are many versions of the kill command. Most shells (ksh, bash, dash, etc) have built-in kill commands, and there's also one in /bin/kill. They are all slightly different but most of them support the above examples.



Most kill commands have a -l or -L option to list the signals:



$ /bin/kill -L
1 HUP 2 INT 3 QUIT 4 ILL 5 TRAP 6 ABRT 7 BUS
8 FPE 9 KILL 10 USR1 11 SEGV 12 USR2 13 PIPE 14 ALRM
15 TERM 16 STKFLT 17 CHLD 18 CONT 19 STOP 20 TSTP 21 TTIN
22 TTOU 23 URG 24 XCPU 25 XFSZ 26 VTALRM 27 PROF 28 WINCH
29 POLL 30 PWR 31 SYS
$


A good place to read about signals is the "signal" man page in section 7 of the manual: man 7 signal.






share|improve this answer


















  • 4




    kill -9 may also be written kill -KILL.
    – Kusalananda
    Oct 20 '17 at 21:43










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399438%2fdifference-between-kill-9-pid-and-kill-int-pid%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
8
down vote



accepted










kill -INT $pid sends the "interrupt" signal to the process with process ID pid. However, the process may decide to ignore the signal, or catch the signal and do something before exiting and/or ignore it.



kill -9 $pid sends the "kill" signal which cannot be caught or ignored. The process will be forcibly shut down with no notification to the process, and no chance to do any cleanup what so ever. kill -9 $pid should almost never be recommended or used, though sometimes it's necessary.



Advanced Concepts



kill -INT $pid is the same as kill -2 $pid.
kill -9 $pid is the same as kill -KILL $pid



There are many versions of the kill command. Most shells (ksh, bash, dash, etc) have built-in kill commands, and there's also one in /bin/kill. They are all slightly different but most of them support the above examples.



Most kill commands have a -l or -L option to list the signals:



$ /bin/kill -L
1 HUP 2 INT 3 QUIT 4 ILL 5 TRAP 6 ABRT 7 BUS
8 FPE 9 KILL 10 USR1 11 SEGV 12 USR2 13 PIPE 14 ALRM
15 TERM 16 STKFLT 17 CHLD 18 CONT 19 STOP 20 TSTP 21 TTIN
22 TTOU 23 URG 24 XCPU 25 XFSZ 26 VTALRM 27 PROF 28 WINCH
29 POLL 30 PWR 31 SYS
$


A good place to read about signals is the "signal" man page in section 7 of the manual: man 7 signal.






share|improve this answer


















  • 4




    kill -9 may also be written kill -KILL.
    – Kusalananda
    Oct 20 '17 at 21:43














up vote
8
down vote



accepted










kill -INT $pid sends the "interrupt" signal to the process with process ID pid. However, the process may decide to ignore the signal, or catch the signal and do something before exiting and/or ignore it.



kill -9 $pid sends the "kill" signal which cannot be caught or ignored. The process will be forcibly shut down with no notification to the process, and no chance to do any cleanup what so ever. kill -9 $pid should almost never be recommended or used, though sometimes it's necessary.



Advanced Concepts



kill -INT $pid is the same as kill -2 $pid.
kill -9 $pid is the same as kill -KILL $pid



There are many versions of the kill command. Most shells (ksh, bash, dash, etc) have built-in kill commands, and there's also one in /bin/kill. They are all slightly different but most of them support the above examples.



Most kill commands have a -l or -L option to list the signals:



$ /bin/kill -L
1 HUP 2 INT 3 QUIT 4 ILL 5 TRAP 6 ABRT 7 BUS
8 FPE 9 KILL 10 USR1 11 SEGV 12 USR2 13 PIPE 14 ALRM
15 TERM 16 STKFLT 17 CHLD 18 CONT 19 STOP 20 TSTP 21 TTIN
22 TTOU 23 URG 24 XCPU 25 XFSZ 26 VTALRM 27 PROF 28 WINCH
29 POLL 30 PWR 31 SYS
$


A good place to read about signals is the "signal" man page in section 7 of the manual: man 7 signal.






share|improve this answer


















  • 4




    kill -9 may also be written kill -KILL.
    – Kusalananda
    Oct 20 '17 at 21:43












up vote
8
down vote



accepted







up vote
8
down vote



accepted






kill -INT $pid sends the "interrupt" signal to the process with process ID pid. However, the process may decide to ignore the signal, or catch the signal and do something before exiting and/or ignore it.



kill -9 $pid sends the "kill" signal which cannot be caught or ignored. The process will be forcibly shut down with no notification to the process, and no chance to do any cleanup what so ever. kill -9 $pid should almost never be recommended or used, though sometimes it's necessary.



Advanced Concepts



kill -INT $pid is the same as kill -2 $pid.
kill -9 $pid is the same as kill -KILL $pid



There are many versions of the kill command. Most shells (ksh, bash, dash, etc) have built-in kill commands, and there's also one in /bin/kill. They are all slightly different but most of them support the above examples.



Most kill commands have a -l or -L option to list the signals:



$ /bin/kill -L
1 HUP 2 INT 3 QUIT 4 ILL 5 TRAP 6 ABRT 7 BUS
8 FPE 9 KILL 10 USR1 11 SEGV 12 USR2 13 PIPE 14 ALRM
15 TERM 16 STKFLT 17 CHLD 18 CONT 19 STOP 20 TSTP 21 TTIN
22 TTOU 23 URG 24 XCPU 25 XFSZ 26 VTALRM 27 PROF 28 WINCH
29 POLL 30 PWR 31 SYS
$


A good place to read about signals is the "signal" man page in section 7 of the manual: man 7 signal.






share|improve this answer














kill -INT $pid sends the "interrupt" signal to the process with process ID pid. However, the process may decide to ignore the signal, or catch the signal and do something before exiting and/or ignore it.



kill -9 $pid sends the "kill" signal which cannot be caught or ignored. The process will be forcibly shut down with no notification to the process, and no chance to do any cleanup what so ever. kill -9 $pid should almost never be recommended or used, though sometimes it's necessary.



Advanced Concepts



kill -INT $pid is the same as kill -2 $pid.
kill -9 $pid is the same as kill -KILL $pid



There are many versions of the kill command. Most shells (ksh, bash, dash, etc) have built-in kill commands, and there's also one in /bin/kill. They are all slightly different but most of them support the above examples.



Most kill commands have a -l or -L option to list the signals:



$ /bin/kill -L
1 HUP 2 INT 3 QUIT 4 ILL 5 TRAP 6 ABRT 7 BUS
8 FPE 9 KILL 10 USR1 11 SEGV 12 USR2 13 PIPE 14 ALRM
15 TERM 16 STKFLT 17 CHLD 18 CONT 19 STOP 20 TSTP 21 TTIN
22 TTOU 23 URG 24 XCPU 25 XFSZ 26 VTALRM 27 PROF 28 WINCH
29 POLL 30 PWR 31 SYS
$


A good place to read about signals is the "signal" man page in section 7 of the manual: man 7 signal.







share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 26 '17 at 3:37

























answered Oct 20 '17 at 21:36









RobertL

4,685523




4,685523







  • 4




    kill -9 may also be written kill -KILL.
    – Kusalananda
    Oct 20 '17 at 21:43












  • 4




    kill -9 may also be written kill -KILL.
    – Kusalananda
    Oct 20 '17 at 21:43







4




4




kill -9 may also be written kill -KILL.
– Kusalananda
Oct 20 '17 at 21:43




kill -9 may also be written kill -KILL.
– Kusalananda
Oct 20 '17 at 21:43

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f399438%2fdifference-between-kill-9-pid-and-kill-int-pid%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?