{"id":17769,"date":"2024-11-18T14:32:21","date_gmt":"2024-11-18T06:32:21","guid":{"rendered":"https:\/\/fwq.ai\/blog\/17769\/"},"modified":"2024-11-18T14:32:21","modified_gmt":"2024-11-18T06:32:21","slug":"linux%e7%bb%88%e7%ab%af%e4%b9%b1%e7%a0%81%e9%97%ae%e9%a2%98%e7%9a%84%e5%a4%84%e7%90%86%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/17769\/","title":{"rendered":"Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/000\/887\/227\/171091872438559.jpg\" class=\"aligncenter\" title=\"Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5\u63d2\u56fe\" alt=\"Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5\u63d2\u56fe\" \/><\/p>\n<p>Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5<\/p>\n<p>\u5728\u4f7f\u7528Linux\u7cfb\u7edf\u65f6\uff0c\u6709\u65f6\u5019\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7684\u6587\u5b57\u4f1a\u51fa\u73b0\u4e71\u7801\uff0c\u8fd9\u7ed9\u6211\u4eec\u4f7f\u7528\u7ec8\u7aef\u5e26\u6765\u4e86\u4e0d\u4fbf\uff0c\u9700\u8981\u53ca\u65f6\u5904\u7406\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e9b\u5e38\u89c1\u7684Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5\uff0c\u540c\u65f6\u63d0\u4f9b\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\u3002<\/p>\n<h3>\u95ee\u9898\u4e00\uff1a\u7ec8\u7aef\u4e2d\u6587\u4e71\u7801<\/h3>\n<p>\u7ec8\u7aef\u4e2d\u6587\u4e71\u7801\u901a\u5e38\u662f\u7531\u4e8e\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e0d\u6b63\u786e\u5bfc\u81f4\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<pre># \u67e5\u770b\u5f53\u524d\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\nlocale charmap\n\n# \u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e3aUTF-8\nexport LANG=zh_CN.UTF-8<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h3>\u95ee\u9898\u4e8c\uff1a\u6587\u4ef6\u540d\u4e71\u7801<\/h3>\n<p>\u6709\u65f6\u5019\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7684\u6587\u4ef6\u540d\u4f1a\u51fa\u73b0\u4e71\u7801\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u6587\u4ef6\u540d\u7684\u7f16\u7801\u683c\u5f0f\u4e0d\u6b63\u786e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u6587\u4ef6\u540d\u7684\u7f16\u7801\u683c\u5f0f\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<pre># \u4ee5UTF-8\u7f16\u7801\u683c\u5f0f\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\ntouch \u6587\u4ef6\u540d\n\n# \u4ee5UTF-8\u7f16\u7801\u683c\u5f0f\u91cd\u547d\u540d\u6587\u4ef6\nmv \u65e7\u6587\u4ef6\u540d \u65b0\u6587\u4ef6\u540d<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h3>\u95ee\u9898\u4e09\uff1a\u7ec8\u7aef\u663e\u793a\u4e71\u7801<\/h3>\n<p>\u6709\u65f6\u5019\u5728\u7ec8\u7aef\u663e\u793a\u7279\u6b8a\u5b57\u7b26\u6216\u8005\u989c\u8272\u65f6\u4f1a\u51fa\u73b0\u4e71\u7801\u95ee\u9898\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\u4e0d\u6b63\u786e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<pre># \u67e5\u770b\u5f53\u524d\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\necho $TERM\n\n# \u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\u4e3a\u652f\u6301\u7279\u6b8a\u5b57\u7b26\u7684\u5b57\u4f53\nexport TERM=linux\n\n# \u4fee\u6539\u5b57\u4f53\u989c\u8272\u8bbe\u7f6e\necho -e \"[31m\u8fd9\u662f\u7ea2\u8272\u5b57\u4f53[0m\"<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<h3>\u95ee\u9898\u56db\uff1avim\u7f16\u8f91\u5668\u4e71\u7801<\/h3>\n<p>\u5728\u4f7f\u7528vim\u7f16\u8f91\u5668\u65f6\uff0c\u6709\u65f6\u5019\u4f1a\u51fa\u73b0\u4e71\u7801\u95ee\u9898\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3avim\u7f16\u8f91\u5668\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e0d\u6b63\u786e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539vim\u7f16\u8f91\u5668\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n<pre># \u4fee\u6539vim\u7f16\u8f91\u5668\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e3aUTF-8\necho \"set encoding=utf-8\" &amp;gt;&amp;gt; ~\/.vimrc<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u603b\u7ed3\uff1a<\/p>\n<p>\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u662f\u6bd4\u8f83\u5e38\u89c1\u7684\uff0c\u4f46\u662f\u53ea\u8981\u4e86\u89e3\u4e00\u4e9b\u5904\u7406\u65b9\u6cd5\uff0c\u5c31\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u3002\u901a\u8fc7\u672c\u6587\u4ecb\u7ecd\u7684\u65b9\u6cd5\u548c\u4ee3\u7801\u793a\u4f8b\uff0c\u76f8\u4fe1\u5927\u5bb6\u5728\u9047\u5230Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u65f6\u80fd\u591f\u66f4\u52a0\u4ece\u5bb9\u5730\u5904\u7406\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fLinux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5 \u5728\u4f7f\u7528Linux\u7cfb\u7edf\u65f6\uff0c\u6709\u65f6\u5019\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7684\u6587\u5b57\u4f1a\u51fa\u73b0\u4e71\u7801\uff0c\u8fd9\u7ed9\u6211\u4eec\u4f7f\u7528\u7ec8\u7aef\u5e26\u6765\u4e86\u4e0d\u4fbf\uff0c\u9700\u8981\u53ca\u65f6\u5904\u7406\u3002\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u4e00\u4e9b\u5e38\u89c1\u7684Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5\uff0c\u540c\u65f6\u63d0\u4f9b\u5177\u4f53\u7684\u4ee3\u7801\u793a\u4f8b\u3002 \u95ee\u9898\u4e00\uff1a\u7ec8\u7aef\u4e2d\u6587\u4e71\u7801 \u7ec8\u7aef\u4e2d\u6587\u4e71\u7801\u901a\u5e38\u662f\u7531\u4e8e\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e0d\u6b63\u786e\u5bfc\u81f4\u7684\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 # \u67e5\u770b\u5f53\u524d\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e locale charmap # \u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e3aUTF-8 export LANG=zh_CN.UTF-8 \u767b\u5f55\u540e\u590d\u5236 \u95ee\u9898\u4e8c\uff1a\u6587\u4ef6\u540d\u4e71\u7801 \u6709\u65f6\u5019\u5728\u7ec8\u7aef\u4e2d\u663e\u793a\u7684\u6587\u4ef6\u540d\u4f1a\u51fa\u73b0\u4e71\u7801\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u6587\u4ef6\u540d\u7684\u7f16\u7801\u683c\u5f0f\u4e0d\u6b63\u786e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u6587\u4ef6\u540d\u7684\u7f16\u7801\u683c\u5f0f\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 # \u4ee5UTF-8\u7f16\u7801\u683c\u5f0f\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6 touch \u6587\u4ef6\u540d # \u4ee5UTF-8\u7f16\u7801\u683c\u5f0f\u91cd\u547d\u540d\u6587\u4ef6 mv \u65e7\u6587\u4ef6\u540d \u65b0\u6587\u4ef6\u540d \u767b\u5f55\u540e\u590d\u5236 \u95ee\u9898\u4e09\uff1a\u7ec8\u7aef\u663e\u793a\u4e71\u7801 \u6709\u65f6\u5019\u5728\u7ec8\u7aef\u663e\u793a\u7279\u6b8a\u5b57\u7b26\u6216\u8005\u989c\u8272\u65f6\u4f1a\u51fa\u73b0\u4e71\u7801\u95ee\u9898\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\u4e0d\u6b63\u786e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 # \u67e5\u770b\u5f53\u524d\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e echo $TERM # \u4fee\u6539\u7ec8\u7aef\u7684\u5b57\u4f53\u8bbe\u7f6e\u4e3a\u652f\u6301\u7279\u6b8a\u5b57\u7b26\u7684\u5b57\u4f53 export TERM=linux # \u4fee\u6539\u5b57\u4f53\u989c\u8272\u8bbe\u7f6e echo -e &#8220;[31m\u8fd9\u662f\u7ea2\u8272\u5b57\u4f53[0m&#8221; \u767b\u5f55\u540e\u590d\u5236 \u95ee\u9898\u56db\uff1avim\u7f16\u8f91\u5668\u4e71\u7801 \u5728\u4f7f\u7528vim\u7f16\u8f91\u5668\u65f6\uff0c\u6709\u65f6\u5019\u4f1a\u51fa\u73b0\u4e71\u7801\u95ee\u9898\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3avim\u7f16\u8f91\u5668\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e0d\u6b63\u786e\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539vim\u7f16\u8f91\u5668\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 # \u4fee\u6539vim\u7f16\u8f91\u5668\u7684\u5b57\u7b26\u7f16\u7801\u8bbe\u7f6e\u4e3aUTF-8 echo &#8220;set encoding=utf-8&#8221; &amp;gt;&amp;gt; ~\/.vimrc \u767b\u5f55\u540e\u590d\u5236 \u603b\u7ed3\uff1a \u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u662f\u6bd4\u8f83\u5e38\u89c1\u7684\uff0c\u4f46\u662f\u53ea\u8981\u4e86\u89e3\u4e00\u4e9b\u5904\u7406\u65b9\u6cd5\uff0c\u5c31\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u89e3\u51b3\u8fd9\u4e9b\u95ee\u9898\u3002\u901a\u8fc7\u672c\u6587\u4ecb\u7ecd\u7684\u65b9\u6cd5\u548c\u4ee3\u7801\u793a\u4f8b\uff0c\u76f8\u4fe1\u5927\u5bb6\u5728\u9047\u5230Linux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u65f6\u80fd\u591f\u66f4\u52a0\u4ece\u5bb9\u5730\u5904\u7406\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u5927\u5bb6\u6709\u6240\u5e2e\u52a9\uff01 \u4ee5\u4e0a\u5c31\u662fLinux\u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u7684\u5904\u7406\u65b9\u6cd5\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/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-17769","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17769","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=17769"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/17769\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=17769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=17769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=17769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}