{"id":46919,"date":"2023-04-18T18:06:05","date_gmt":"2023-04-18T10:06:05","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=46919"},"modified":"2023-04-18T18:06:05","modified_gmt":"2023-04-18T10:06:05","slug":"windows-bash","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/windows-bash.html","title":{"rendered":"Windows \u4e0a\u7684 Bash \u6b63\u5728\u6210\u4e3a\u5fae\u8f6f\u7684 Linux"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5fae\u8f6f\u5bf9 Windows Subsystem for Linux\uff08WSL\uff09\u7684\u4e00\u7cfb\u5217\u5927\u91cf\u66f4\u65b0\u88ab\u5217\u5165 Windows Insider build 15002\uff0c\u8be5\u7248\u672c\u5df2\u4e8e1\u670810\u65e5\u5f00\u59cb\u63a8\u9001\u7ed9 Windows 10 \u7528\u6237\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5fae\u8f6f\u7684 WSL \u8ba1\u5212\u4ecd\u7136\u662f\u5177\u6709\u8f83\u5f3a\u7684\u6682\u65f6\u6027\u548c\u5b9e\u9a8c\u6027\u7684\uff0c\u4f46\u8be5\u516c\u53f8\u6b63\u5728\u4e0d\u65ad\u5f80\u4e0a\u6dfb\u52a0\u529f\u80fd\uff0c\u4ee5\u98de\u5feb\u7684\u6b65\u4f10\u6539\u8fdb\u548c\u6269\u5c55 WSL\u3002 \u8fd9\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4e5f\u53ef\u4ee5\u770b\u51fa\u662f\u79cd\u63d0\u793a\uff0c\u5fae\u8f6f\u7684\u76ee\u6807\u662f\u4f7f\u5176\u6210\u4e3a\u5176\u4ed6 Linux \u53d1\u884c\u7248\u7684\u53ef\u9760\u66ff\u4ee3\u54c1\u3002
\n\"\"<\/a>
\n\u6700\u65b0\u7248\u672c\u7684 WSL\uff08\u5728 Windows \u4e2d\u79f0\u4e3a Bash \uff09\u6c47\u603b\u4e86 Bash\uff08\u4e00\u4e2a\u6d41\u884c\u7684 Linux \u547d\u4ee4\u884c\u754c\u9762\uff09\u7684\u8bb8\u591a\u7279\u5b9a\u4fee\u590d\u7a0b\u5e8f\uff0c\u81f4\u529b\u4e8e\u63d0\u4f9b\u201c\u4f60\u6700\u559c\u6b22\u7684 Linux \u5de5\u5177\u548c\u6280\u672f\u7684\u66f4\u591a\u517c\u5bb9\u6027\u3001\u6027\u80fd\u548c\u7a33\u5b9a\u6027\u201d\u3002
\n\u5176\u4e2d\u7684\u4e00\u4e9b\u4fee\u590d\u8fd8\u5b9e\u73b0\u4e86\u5728 WSL \u4e2d\u7684 Linux \u5e94\u7528\u4e4b\u524d\u4e0d\u53ef\u7528\u7684\u529f\u80fd\uff0c\u4f8b\u5982\u652f\u6301\u5185\u6838\u5185\u5b58\u8fc7\u91cf\u4f7f\u7528\u548c\u4ee5\u524d\u5ffd\u7565\u7684\u7f51\u7edc\u5806\u6808\u9009\u9879\u3002\u8fd8\u6709\u5176\u4ed6\u66f4\u6539\u589e\u5f3a\u4e86 WSL \u548c Windows \u4e4b\u95f4\u7684\u96c6\u6210\u3002\u4f8b\u5982\uff0c\u5982\u679c\u542f\u7528\u4e86 Windows \u7aef\u5ba1\u6838\uff0c\u5219\u5728 WSL \u4e2d\u521b\u5efa\u7684\u4efb\u4f55 Linux \u8fdb\u7a0b\u7684\u540d\u79f0\u90fd\u5c06\u8bb0\u5f55\u5728\u5ba1\u6838\u65e5\u5fd7\u4e2d\u3002
\n\u8fd8\u6709\u4e00\u4e9b\u6709\u8da3\u7684\u53d8\u5316\uff0c\u6d89\u53ca\u4e24\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u4e4b\u95f4\u7684\u4ea4\u4e92\uff0c\u6bd4\u5982\u65e5\u5fd7\u529f\u80fd\u3002\u5982\u679c\u5728 Windows \u4e3b\u673a\u4e0a\u6709\u8ba1\u91cf\u7f51\u7edc\u8fde\u63a5\uff0c\u5219\u6700\u65b0\u7684 WSL \u4e0d\u4f1a\u5bf9\u5305\u6267\u884c\u8ba1\u5212\u4efb\u52a1\u68c0\u67e5\uff0c\u4ee5\u907f\u514d\u9ad8\u5e26\u5bbd\u3002
\n
\"\"<\/a>
\n\u4e0d\u8fc7 build 15002 \u4e2d\u7684\u8fd8\u6709\u4e00\u4e2a\u95ee\u9898\u662f\uff0c\u5728 Bash \u4f1a\u8bdd\u4e2d\u7684 Ctrl-C \u65e0\u6cd5\u5de5\u4f5c\u3002\u5fae\u8f6f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u89e3\u51b3\u65b9\u5411\uff0c\u8bf4\u5fc5\u987b\u4e0e Windows \u548c Bash \u5f00\u53d1\u56e2\u961f\u4e4b\u95f4\u540c\u6b65\u3002\u4e0b\u4e00\u4e2a Insider build \u5e94\u8be5\u4f1a\u6709\u4e00\u4e2a\u4fee\u590d\u3002\u4f46\u662f\u5bf9\u4e8e\u91cd\u5ea6\u4f7f\u7528 Linux \u547d\u4ee4\u884c\u8fdb\u884c\u5de5\u4f5c\u7684\u4eba\u6765\u8bf4\uff0c\u6ca1\u6709 Ctrl-C \u6709\u70b9\u50cf\u5f00\u8f66\u53ea\u6709\u524d\u5236\u52a8\u5668\u3002
\nguest \u548c host OSes \u5728VM\u7cfb\u7edf\uff08\u5982Hyper-V\uff09\u4e2d\u76f8\u4e92\u4ea4\u4e92\u7684\u65b9\u5f0f\u4e3a\u5fae\u8f6f\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7528\u4e8e\u5c06\u6765\u5904\u7406\u8de8\u64cd\u4f5c\u7cfb\u7edf\u95ee\u9898\u7684\u6a21\u578b\u3002\u4f46\u662f WSL \u4e0d\u662f\u6258\u7ba1\u5728VM\u4e2d - \u5728\u67d0\u4e9b\u65b9\u9762\uff0c\u5b83\u66f4\u6709\u91ce\u5fc3\uff1a\u7cfb\u7edf\u8c03\u7528\u8f6c\u6362\u5c42\u5c06\u6bcf\u4e2a Linux \u7cfb\u7edf\u8c03\u7528\u6620\u5c04\u5230\u76f8\u5e94\u7684 Windows \u7cfb\u7edf\u8c03\u7528\u3002\u4e0d\u8fc7\u5c06 WSL \u8f6c\u53d8\u4e3a\u4e00\u4e2a Linux \u7528\u6237\u5728 Windows \u4e0a\u7684\u5b8c\u6574\u7684\u751f\u4ea7\u73af\u5883\u8fd8\u662f\u5f88\u96be - \u8fd9\u6bd5\u7adf\u662f\u4e00\u4e2a\u957f\u8fdc\u7684\u76ee\u6807\u3002
\n\u5fae\u8f6f\u6709\u4e00\u5929\u751f\u4ea7\u81ea\u5df1\u7684 Linux \u53d1\u884c\u6216\u8d2d\u4e70\u4e00\u4e2a\u7136\u540e\u91cd\u5851\u7684\u8bf4\u6cd5\u5df2\u7ecf\u5f88\u4e45\u4e86\uff0c\u4f46\u662f\u4f7f\u7528 WSL\uff0c\u5fae\u8f6f\u4f3c\u4e4e\u6b63\u5728\u4ece Windows \u672c\u8eab\u840c\u53d1 Linux \u652f\u6301\u3002
\n\u6784\u5efa WSL \u53ef\u80fd\u662f\u4e00\u4e2a\u6bd4\u5fae\u8f6f\u81ea\u5efa Linux \u54c1\u724c\u8981\u6765\u5f97\u66f4\u5feb\uff0c\u800c\u4e14\u6536\u76ca\u66f4\u5927\u7684\u65b9\u5f0f\u3002 WSL \u4f7f\u7528\u6237\u80fd\u591f\u5728 Linux \u547d\u4ee4\u884c\uff0cWindows \u684c\u9762\u548c PowerShell \u4e2d\u540c\u65f6\u4f7f\u7528\u3002\u5e76\u4e14\u5b83\u4e3a\u5fae\u8f6f\u63d0\u4f9b\u4e86\u53e6\u4e00\u79cd\u65b9\u5f0f\u6765\u5438\u5f15\u548c\u4fdd\u7559 Windows \u7528\u6237\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.linuxeden.com\/html\/news\/20170113\/167752.html<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/windows-bash.html<\/a>\u7f16\u8f91\uff1a\u5f20\u5e9a\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u5bfc\u8bfb \u5fae\u8f6f\u5bf9 Windows Subsystem for Linux\uff08WSL\uff09\u7684\u4e00\u7cfb\u5217\u5927\u91cf\u66f4\u65b0\u88ab\u5217\u5165 Wind […]<\/p>\n","protected":false},"author":63,"featured_media":46922,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[21],"tags":[],"class_list":["post-46919","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-news"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/46919","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=46919"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/46919\/revisions"}],"predecessor-version":[{"id":269773,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/46919\/revisions\/269773"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/46922"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=46919"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=46919"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=46919"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}