{"id":51660,"date":"2024-12-03T09:10:24","date_gmt":"2024-12-03T01:10:24","guid":{"rendered":"https:\/\/fwq.ai\/blog\/51660\/"},"modified":"2024-12-03T09:10:24","modified_gmt":"2024-12-03T01:10:24","slug":"%e5%a4%84%e7%90%86linux%e7%bb%88%e7%ab%af%e6%98%be%e7%a4%ba%e4%b9%b1%e7%a0%81%e7%9a%84%e6%96%b9%e6%b3%95","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/51660\/","title":{"rendered":"\u5904\u7406Linux\u7ec8\u7aef\u663e\u793a\u4e71\u7801\u7684\u65b9\u6cd5"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>\u5904\u7406Linux\u7ec8\u7aef\u663e\u793a\u4e71\u7801\u7684\u65b9\u6cd5<\/h1>\n<p>Linux \u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u662f\u5e38\u89c1\u6545\u969c\uff0c\u5f71\u54cd\u6587\u5b57\u663e\u793a\u548c\u4f7f\u7528\u4f53\u9a8c\u3002\u672c\u6587\u63d0\u4f9b\u51e0\u79cd\u5904\u7406\u65b9\u6cd5\uff0c\u5305\u62ec\u4fee\u6539\u5b57\u7b26\u7f16\u7801\u3001\u91cd\u547d\u540d\u6587\u4ef6\u3001\u8c03\u6574\u5b57\u4f53\u8bbe\u7f6e\u4ee5\u53ca\u914d\u7f6e vim \u7f16\u8f91\u5668\u3002\u901a\u8fc7\u4e86\u89e3\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u89e3\u51b3 Linux \u7ec8\u7aef\u4e2d\u6587\u4e71\u7801\u3001\u6587\u4ef6\u540d\u4e71\u7801\u3001\u7279\u6b8a\u5b57\u7b26\u4e71\u7801\u548c vim \u7f16\u8f91\u5668\u4e71\u7801\u7b49\u95ee\u9898\u3002<\/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<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<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<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\" &gt;&gt; ~\/.vimrc<\/pre>\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>\u6587\u4e2d\u5173\u4e8eLinux,\u7ec8\u7aef,\u4e71\u7801\u7684\u77e5\u8bc6\u4ecb\u7ecd\uff0c\u5e0c\u671b\u5bf9\u4f60\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\uff01\u82e5\u662f\u53d7\u76ca\u532a\u6d45\uff0c\u90a3\u5c31\u52a8\u52a8\u9f20\u6807\u6536\u85cf\u8fd9\u7bc7\u300a\u5904\u7406Linux\u7ec8\u7aef\u663e\u793a\u4e71\u7801\u7684\u65b9\u6cd5\u300b\u6587\u7ae0\u5427\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u4e86\u89e3\u76f8\u5173\u6280\u672f\u6587\u7ae0\u3002<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   \u5982\u4f55\u5728Windows 10\u4e2d\u542f\u7528\u6e38\u620f\u5e27\u7387\u663e\u793a\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>\u5904\u7406Linux\u7ec8\u7aef\u663e\u793a\u4e71\u7801\u7684\u65b9\u6cd5 Linux \u7ec8\u7aef\u4e71\u7801\u95ee\u9898\u662f\u5e38\u89c1\u6545\u969c\uff0c\u5f71\u54cd\u6587\u5b57\u663e\u793a\u548c\u4f7f\u7528\u4f53\u9a8c\u3002\u672c\u6587\u63d0\u4f9b\u51e0\u79cd\u5904\u7406\u65b9\u6cd5\uff0c\u5305\u62ec\u4fee\u6539\u5b57\u7b26\u7f16\u7801\u3001\u91cd\u547d\u540d\u6587\u4ef6\u3001\u8c03\u6574\u5b57\u4f53\u8bbe\u7f6e\u4ee5\u53ca\u914d\u7f6e vim \u7f16\u8f91\u5668\u3002\u901a\u8fc7\u4e86\u89e3\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u89e3\u51b3 Linux \u7ec8\u7aef\u4e2d\u6587\u4e71\u7801\u3001\u6587\u4ef6\u540d\u4e71\u7801\u3001\u7279\u6b8a\u5b57\u7b26\u4e71\u7801\u548c vim \u7f16\u8f91\u5668\u4e71\u7801\u7b49\u95ee\u9898\u3002 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 \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 \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; \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; &gt;&gt; [&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-51660","post","type-post","status-publish","format-standard","hentry","category-os"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/51660","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=51660"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/51660\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=51660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=51660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=51660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}