{"id":63695,"date":"2025-04-29T17:23:44","date_gmt":"2025-04-29T09:23:44","guid":{"rendered":"https:\/\/fwq.ai\/blog\/63695\/"},"modified":"2025-04-29T17:23:44","modified_gmt":"2025-04-29T09:23:44","slug":"linux%e9%80%80%e5%87%ba%e5%91%bd%e4%bb%a4%e6%80%8e%e4%b9%88%e8%ae%be%e7%bd%ae-2","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/63695\/","title":{"rendered":"linux\u9000\u51fa\u547d\u4ee4\u600e\u4e48\u8bbe\u7f6e"},"content":{"rendered":"<blockquote><p>\n  \u9000\u51fa linux \u547d\u4ee4\u884c\u754c\u9762\u6709\u591a\u79cd\u65b9\u6cd5\uff1a\u5feb\u6377\u952e\uff1actrl+d \u9000\u51fa shell\uff0cctrl+c \u7ec8\u6b62\u547d\u4ee4\u3002\u547d\u4ee4\uff1aexit \u9000\u51fa shell\uff0clogout \u9000\u51fa\u5f53\u524d\u7528\u6237\u3002\u81ea\u5b9a\u4e49\u9000\u51fa\u5feb\u6377\u952e\uff1a\u5728 .bashrc \u6587\u4ef6\u4e2d\u6dfb\u52a0 bindkey \u8bed\u53e5\u3002\u81ea\u5b9a\u4e49\u9000\u51fa\u547d\u4ee4\uff1aexport prompt_command=&#8217;logout&#8217;\u3002\u5173\u95ed\u7ec8\u7aef\u7a97\u53e3\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202406\/04\/2024060412241796981.jpg\" class=\"aligncenter\" title=\"linux\u9000\u51fa\u547d\u4ee4\u600e\u4e48\u8bbe\u7f6e\u63d2\u56fe\" alt=\"linux\u9000\u51fa\u547d\u4ee4\u600e\u4e48\u8bbe\u7f6e\u63d2\u56fe\" \/><\/p>\n<p><strong>Linux \u9000\u51fa\u547d\u4ee4\u8bbe\u7f6e<\/strong><\/p>\n<p>\u9000\u51fa Linux \u547d\u4ee4\u884c\u754c\u9762 (CLI) \u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u504f\u597d\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n<p><strong>1. \u4f7f\u7528\u5feb\u6377\u952e<\/strong><\/p>\n<ul>\n<li> <strong>Ctrl+D<\/strong>\uff1a\u76f4\u63a5\u9000\u51fa\u5f53\u524d shell\u3002<\/li>\n<li> <strong>Ctrl+C<\/strong>\uff1a\u7ec8\u6b62\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684\u547d\u4ee4\u3002<\/li>\n<\/ul>\n<p><strong>2. \u4f7f\u7528\u9000\u51fa\u547d\u4ee4<\/strong><\/p>\n<ul>\n<li> <strong>exit<\/strong>\uff1a\u9000\u51fa\u5f53\u524d shell\u3002<\/li>\n<li> <strong>logout<\/strong>\uff1a\u9000\u51fa\u5f53\u524d\u7528\u6237\u5e76\u8fd4\u56de\u767b\u5f55\u63d0\u793a\u7b26\u3002<\/li>\n<\/ul>\n<p><strong>3. \u8bbe\u7f6e\u9ed8\u8ba4\u9000\u51fa\u5feb\u6377\u952e<\/strong><\/p>\n<p>\u60a8\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u81ea\u5b9a\u4e49\u5feb\u6377\u952e\u6765\u9000\u51fa shell\u3002\u4e3a\u6b64\uff0c\u8bf7\u5728\u7528\u6237\u4e3b\u76ee\u5f55\u7684 .bashrc \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<pre>bindkey -s \"^D\" exit<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>4. \u8bbe\u7f6e\u9ed8\u8ba4\u9000\u51fa\u547d\u4ee4<\/strong><\/p>\n<p>\u60a8\u53ef\u4ee5\u5c06\u9ed8\u8ba4\u9000\u51fa\u547d\u4ee4\u66f4\u6539\u4e3a\u5176\u4ed6\u547d\u4ee4\uff0c\u4f8b\u5982 logout\uff1a<\/p>\n<pre>export PROMPT_COMMAND='logout'<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p><strong>5. \u5173\u95ed\u7ec8\u7aef\u7a97\u53e3<\/strong><\/p>\n<p>\u5173\u95ed\u7ec8\u7aef\u7a97\u53e3\u4e5f\u4f1a\u9000\u51fa shell\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u5355\u51fb\u7a97\u53e3\u53f3\u4e0a\u89d2\u7684\u5173\u95ed\u6309\u94ae\u6216\u4f7f\u7528\u4ee5\u4e0b\u5feb\u6377\u952e\u6765\u5b9e\u73b0\uff1a<\/p>\n<ul>\n<li> <strong>Alt+F4<\/strong> (Windows \u548c Linux)<\/li>\n<li> <strong>Cmd+Q<\/strong> (macOS)<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u9000\u51fa\u547d\u4ee4\u600e\u4e48\u8bbe\u7f6e\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8FDCServers\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9000\u51fa linux \u547d\u4ee4\u884c\u754c\u9762\u6709\u591a\u79cd\u65b9\u6cd5\uff1a\u5feb\u6377\u952e\uff1actrl+d \u9000\u51fa shell\uff0cctrl+c \u7ec8\u6b62\u547d\u4ee4\u3002\u547d\u4ee4\uff1aexit \u9000\u51fa shell\uff0clogout \u9000\u51fa\u5f53\u524d\u7528\u6237\u3002\u81ea\u5b9a\u4e49\u9000\u51fa\u5feb\u6377\u952e\uff1a\u5728 .bashrc \u6587\u4ef6\u4e2d\u6dfb\u52a0 bindkey \u8bed\u53e5\u3002\u81ea\u5b9a\u4e49\u9000\u51fa\u547d\u4ee4\uff1aexport prompt_command=&#8217;logout&#8217;\u3002\u5173\u95ed\u7ec8\u7aef\u7a97\u53e3\u3002 Linux \u9000\u51fa\u547d\u4ee4\u8bbe\u7f6e \u9000\u51fa Linux \u547d\u4ee4\u884c\u754c\u9762 (CLI) \u6709\u591a\u79cd\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u7684\u504f\u597d\u8fdb\u884c\u8bbe\u7f6e\u3002 1. \u4f7f\u7528\u5feb\u6377\u952e Ctrl+D\uff1a\u76f4\u63a5\u9000\u51fa\u5f53\u524d shell\u3002 Ctrl+C\uff1a\u7ec8\u6b62\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684\u547d\u4ee4\u3002 2. \u4f7f\u7528\u9000\u51fa\u547d\u4ee4 exit\uff1a\u9000\u51fa\u5f53\u524d shell\u3002 logout\uff1a\u9000\u51fa\u5f53\u524d\u7528\u6237\u5e76\u8fd4\u56de\u767b\u5f55\u63d0\u793a\u7b26\u3002 3. \u8bbe\u7f6e\u9ed8\u8ba4\u9000\u51fa\u5feb\u6377\u952e \u60a8\u8fd8\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u81ea\u5b9a\u4e49\u5feb\u6377\u952e\u6765\u9000\u51fa shell\u3002\u4e3a\u6b64\uff0c\u8bf7\u5728\u7528\u6237\u4e3b\u76ee\u5f55\u7684 .bashrc \u6587\u4ef6\u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a bindkey -s &#8220;^D&#8221; exit \u767b\u5f55\u540e\u590d\u5236 4. \u8bbe\u7f6e\u9ed8\u8ba4\u9000\u51fa\u547d\u4ee4 \u60a8\u53ef\u4ee5\u5c06\u9ed8\u8ba4\u9000\u51fa\u547d\u4ee4\u66f4\u6539\u4e3a\u5176\u4ed6\u547d\u4ee4\uff0c\u4f8b\u5982 logout\uff1a export PROMPT_COMMAND=&#8217;logout&#8217; \u767b\u5f55\u540e\u590d\u5236 5. \u5173\u95ed\u7ec8\u7aef\u7a97\u53e3 \u5173\u95ed\u7ec8\u7aef\u7a97\u53e3\u4e5f\u4f1a\u9000\u51fa shell\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u5355\u51fb\u7a97\u53e3\u53f3\u4e0a\u89d2\u7684\u5173\u95ed\u6309\u94ae\u6216\u4f7f\u7528\u4ee5\u4e0b\u5feb\u6377\u952e\u6765\u5b9e\u73b0\uff1a Alt+F4 (Windows [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-63695","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63695","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=63695"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/63695\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=63695"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=63695"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=63695"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}