{"id":683,"date":"2019-04-23T22:09:00","date_gmt":"2019-04-23T14:09:00","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=683"},"modified":"2022-05-10T03:36:50","modified_gmt":"2022-05-09T19:36:50","slug":"kill","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/kill","title":{"rendered":"kill\u547d\u4ee4 – \u6740\u6b7b\u8fdb\u7a0b"},"content":{"rendered":"\n

kill\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u6740\u6b7b\uff08\u7ed3\u675f\uff09\u8fdb\u7a0b\uff0c\u4e0e\u82f1\u6587\u5355\u8bcd\u7684\u542b\u4e49\u76f8\u540c\u3002Linux\u7cfb\u7edf\u4e2d\u5982\u9700\u7ed3\u675f\u67d0\u4e2a\u8fdb\u7a0b\uff0c\u65e2\u53ef\u4ee5\u4f7f\u7528\u5982service\u6216systemctl\u7684\u7ba1\u7406\u547d\u4ee4\u6765\u7ed3\u675f\u670d\u52a1\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528kill\u547d\u4ee4\u76f4\u63a5\u7ed3\u675f\u8fdb\u7a0b\u4fe1\u606f\u3002<\/p>\n\n\n\n

\u5982\u4f7f\u7528kill\u547d\u4ee4\u540e\u8fdb\u7a0b\u5e76\u6ca1\u6709\u88ab\u7ed3\u675f\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u4fe1\u53f79\u8fdb\u884c\u5f3a\u5236\u6740\u6b7b\u52a8\u4f5c\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>kill [\u53c2\u6570] \u8fdb\u7a0b\u53f7<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-l<\/td>\u5217\u51fa\u7cfb\u7edf\u652f\u6301\u7684\u4fe1\u53f7<\/td><\/tr>
-s<\/td>\u6307\u5b9a\u5411\u8fdb\u7a0b\u53d1\u9001\u7684\u4fe1\u53f7<\/td><\/tr>
-a<\/td>\u4e0d\u9650\u5236\u547d\u4ee4\u540d\u548c\u8fdb\u7a0b\u53f7\u7684\u5bf9\u5e94\u5173\u7cfb<\/td><\/tr>
-p<\/td>\u4e0d\u53d1\u9001\u4efb\u4f55\u4fe1\u53f7<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u5217\u51fa\u7cfb\u7edf\u652f\u6301\u7684\u5168\u90e8\u4fe1\u53f7\u5217\u8868\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# kill -l<\/strong>\r\n 1) SIGHUP\t 2) SIGINT\t 3) SIGQUIT\t 4) SIGILL\t 5) SIGTRAP\r\n 6) SIGABRT\t 7) SIGBUS\t 8) SIGFPE\t 9) SIGKILL\t10) SIGUSR1\r\n11) SIGSEGV\t12) SIGUSR2\t13) SIGPIPE\t14) SIGALRM\t15) SIGTERM\r\n16) SIGSTKFLT\t17) SIGCHLD\t18) SIGCONT\t19) SIGSTOP\t20) SIGTSTP\r\n21) SIGTTIN\t22) SIGTTOU\t23) SIGURG\t24) SIGXCPU\t25) SIGXFSZ\r\n26) SIGVTALRM\t27) SIGPROF\t28) SIGWINCH\t29) SIGIO\t30) SIGPWR\r\n31) SIGSYS\t34) SIGRTMIN\t35) SIGRTMIN+1\t36) SIGRTMIN+2\t37) SIGRTMIN+3\r\n38) SIGRTMIN+4\t39) SIGRTMIN+5\t40) SIGRTMIN+6\t41) SIGRTMIN+7\t42) SIGRTMIN+8\r\n43) SIGRTMIN+9\t44) SIGRTMIN+10\t45) SIGRTMIN+11\t46) SIGRTMIN+12\t47) SIGRTMIN+13\r\n48) SIGRTMIN+14\t49) SIGRTMIN+15\t50) SIGRTMAX-14\t51) SIGRTMAX-13\t52) SIGRTMAX-12\r\n53) SIGRTMAX-11\t54) SIGRTMAX-10\t55) SIGRTMAX-9\t56) SIGRTMAX-8\t57) SIGRTMAX-7\r\n58) SIGRTMAX-6\t59) SIGRTMAX-5\t60) SIGRTMAX-4\t61) SIGRTMAX-3\t62) SIGRTMAX-2\r\n63) SIGRTMAX-1\t64) SIGRTMAX\t\r<\/pre>\n\n\n\n

\u7ed3\u675f\u67d0\u4e2a\u6307\u5b9a\u7684\u8fdb\u7a0b\uff08\u6570\u5b57\u4e3a\u5bf9\u5e94\u7684PID\u503c\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# kill 1518<\/strong><\/pre>\n\n\n\n

\u5f3a\u5236\u7ed3\u675f\u67d0\u4e2a\u6307\u5b9a\u7684\u8fdb\u7a0b\uff08\u6570\u5b57\u4e3a\u5bf9\u5e94\u7684PID\u503c\uff09\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# kill -9 1518<\/strong>\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

kill\u547d\u4ee4\u7684\u529f\u80fd\u662f\u7528\u4e8e\u6740\u6b7b\uff08\u7ed3\u675f\uff09\u8fdb\u7a0b\uff0c\u4e0e\u82f1\u6587\u5355\u8bcd\u7684\u542b\u4e49\u76f8\u540c\u3002Linux\u7cfb\u7edf\u4e2d\u5982\u9700\u7ed3\u675f\u67d0\u4e2a\u8fdb\u7a0b\uff0c\u65e2\u53ef\u4ee5\u4f7f\u7528\u5982 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/683"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=683"}],"version-history":[{"count":22,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/683\/revisions"}],"predecessor-version":[{"id":9453,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/683\/revisions\/9453"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}