{"id":1333,"date":"2011-08-01T20:18:07","date_gmt":"2011-08-01T12:18:07","guid":{"rendered":"http:\/\/www.jpuyy.com\/blog\/?p=1333"},"modified":"2012-11-25T11:35:15","modified_gmt":"2012-11-25T03:35:15","slug":"linux-pkill-kill-usage","status":"publish","type":"post","link":"https:\/\/jpuyy.com\/?p=1333","title":{"rendered":"\u4f7f\u7528pkill\u8e22\u6389linux\u7528\u6237"},"content":{"rendered":"<p>\u5148\u770b\u770b\u90fd\u54ea\u4e9b\u7ec8\u7aef\u767b\u9646<\/p>\n<pre>root@ibm:~# w\r\n19:28:23 up 2 days, 12:12, 1 user, load average: 0.20, 0.29, 0.33\r\nUSER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT\r\nroot pts\/0 192.168.1.102 19:12 1.00s 1.24s 0.02s w<\/pre>\n<p>\u7528\u6237\u5e10\u53f7\/\u6240\u7528\u7684\u7ec8\u7aef\/\u4f55\u5904\u767b\u9646\/\u767b\u9646\u65f6\u95f4\/\u7a7a\u95f2\u65f6\u95f4\/\u8017\u8d39\u7684CPU\/\u6267\u884c\u540e\u8017\u8d39CPU\/\u6b63\u5728\u6267\u884c<\/p>\n<pre>root pts\/0 192.168.1.102 19:12 1.00s 1.24s 0.02s w<\/pre>\n<p>\u4e0a\u9762\u53ef\u4ee5\u770b\u5230\u53ea\u6709\u6211\u4e00\u4e2a\u7528\u6237\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4f1a\u5c06\u6211\u81ea\u5df1\u8e22\u51fa\uff1a<\/p>\n<pre>pkill -kill -t pts\/0<\/pre>\n<p>\u8fdb\u800c\u884d\u751f\u51fa\u5bf9pkill\u7528\u6cd5\u7684\u6574\u7406<\/p>\n<p><tt>pkill<\/tt> is used to send signals to Process (computing)processes. The <tt>pkill<\/tt> command allows the use of extended regular expression patterns and other matching criteria.<\/p>\n<p>pkill\u7684\u4f7f\u7528\u662f\u53d1\u9001\u4fe1\u53f7\u7ed9\u8fdb\u7a0b\uff0c\u652f\u6301\u6269\u5c55\u6b63\u5219\u8868\u8fbe\u5f0f\u6216\u5176\u4ed6\u5339\u914d\u89c4\u5219.<\/p>\n<p>pgrep, pkill &#8211; look up or signal processes based on name and other attributes\u3002<\/p>\n<p>\u540e\u9762\u8ddf\u8fdb\u7a0b\u540d\u800ckill\u53ea\u80fd\u8ddf\u8fdb\u7a0b\u53f7\uff0cpkill\u8fd8\u652f\u6301\u81ea\u52a8\u8865\u5168<\/p>\n<p>\u90a3\u4e48\uff0c\u5982\u679c\u8bf4xxx\u6709\u4e24\u4e2a\u8fdb\u7a0b<\/p>\n<p>root\u00a0\u00a0\u00a0\u00a0 10976\u00a0\u00a0\u00a0\u00a0 1\u00a0 0 Jul31 ?\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a000:00:00 xxx: master process usr\/local\/xxx\/sbin\/xxx<br \/>\nwww-data 10978 10976\u00a0 0 Jul31 ?\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 00:00:00 xxx: worker process<\/p>\n<p>\u8fd0\u884cpkill xxx \u4f1a\u628a\u4ed6\u4eec\u5168\u6740\u6b7b\uff0c\u6709\u65f6\u6211\u4eec\u5e76\u4e0d\u60f3\u8981\u8fd9\u6837\u7684\u7ed3\u679c\uff0c\u6240\u4ee5\u8981\u8ba4\u51c6\u4e86\u518d\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5148\u770b\u770b\u90fd\u54ea\u4e9b\u7ec8\u7aef\u767b\u9646 root@ibm:~# w 19:28:23 up 2 days, 12:12, 1 user, load average: 0.20, 0.29, 0.33 USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT root pts\/0 192.168.1.102 19:12 1.00s 1.24s 0.02s w \u7528\u6237\u5e10\u53f7\/\u6240\u7528\u7684\u7ec8\u7aef\/\u4f55\u5904\u767b\u9646\/\u767b\u9646\u65f6\u95f4\/\u7a7a\u95f2\u65f6\u95f4\/\u8017\u8d39\u7684CPU\/\u6267\u884c\u540e\u8017\u8d39CPU\/\u6b63\u5728\u6267\u884c root pts\/0 192.168.1.102 19:12 1.00s 1.24s 0.02s w \u4e0a\u9762\u53ef\u4ee5\u770b\u5230\u53ea\u6709\u6211\u4e00\u4e2a\u7528\u6237\uff0c\u4f7f\u7528\u5982\u4e0b\u547d\u4ee4\u4f1a\u5c06\u6211\u81ea\u5df1\u8e22\u51fa\uff1a pkill -kill -t pts\/0 \u8fdb\u800c\u884d\u751f\u51fa\u5bf9pkill\u7528\u6cd5\u7684\u6574\u7406 pkill is used to send signals to Process (computing)processes. [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-1333","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1333","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1333"}],"version-history":[{"count":22,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1333\/revisions"}],"predecessor-version":[{"id":4258,"href":"https:\/\/jpuyy.com\/index.php?rest_route=\/wp\/v2\/posts\/1333\/revisions\/4258"}],"wp:attachment":[{"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1333"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1333"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpuyy.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1333"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}