{"id":147145,"date":"2019-06-12T10:49:17","date_gmt":"2019-06-12T02:49:17","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=147145"},"modified":"2019-06-04T16:49:23","modified_gmt":"2019-06-04T08:49:23","slug":"windows-linux-bash-2","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/windows-linux-bash-2.html","title":{"rendered":"\u5728 Windows \u4e2d\u8fd0\u884c Linux bash \u547d\u4ee4\u7684\u51e0\u79cd\u65b9\u6cd5"},"content":{"rendered":"

\u5982\u679c\u4f60\u6b63\u5728\u8bfe\u7a0b\u4e2d\u6b63\u5728\u5b66\u4e60 shell \u811a\u672c\uff0c\u90a3\u4e48\u9700\u8981\u4f7f\u7528 Linux \u547d\u4ee4\u6765\u7ec3\u4e60\u547d\u4ee4\u548c\u811a\u672c\u3002<\/p>\n

\u4f60\u7684\u5b66\u6821\u5b9e\u9a8c\u5ba4\u53ef\u80fd\u5b89\u88c5\u4e86 Linux\uff0c\u4f46\u662f\u4f60\u81ea\u5df1\u6ca1\u6709\u5b89\u88c5\u4e86\u00a0Linux \u7684\u7b14\u8bb0\u672c\u7535\u8111\uff0c\u800c\u662f\u50cf\u5176\u4ed6\u4eba\u4e00\u6837\u7684 Windows \u8ba1\u7b97\u673a\u3002\u4f60\u7684\u4f5c\u4e1a\u9700\u8981\u8fd0\u884c Linux \u547d\u4ee4\uff0c\u4f60\u6216\u8bb8\u60f3\u77e5\u9053\u5982\u4f55\u5728 Windows \u4e0a\u8fd0\u884c Bash \u547d\u4ee4\u548c\u811a\u672c\u3002<\/p>\n

\u4f60\u53ef\u4ee5\u5728\u53cc\u542f\u52a8\u6a21\u5f0f\u4e0b\u540c\u65f6\u5b89\u88c5 Windows \u548c Linux\u3002\u6b64\u65b9\u6cd5\u80fd\u8ba9\u4f60\u5728\u542f\u52a8\u8ba1\u7b97\u673a\u65f6\u9009\u62e9 Linux \u6216 Windows\u3002\u4f46\u662f\uff0c\u4e3a\u4e86\u8fd0\u884c Linux \u547d\u4ee4\u800c\u4f7f\u7528\u5355\u72ec\u5206\u533a\u7684\u9ebb\u70e6\u53ef\u80fd\u4e0d\u9002\u5408\u6240\u6709\u4eba\u3002<\/p>\n

\u4f60\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5728\u7ebf Linux \u7ec8\u7aef\uff0c\u4f46\u4f60\u7684\u4f5c\u4e1a\u65e0\u6cd5\u4fdd\u5b58\u3002<\/p>\n

\u597d\u6d88\u606f\u662f\uff0c\u6709\u51e0\u79cd\u65b9\u6cd5\u53ef\u4ee5\u5728 Windows \u4e2d\u8fd0\u884c Linux \u547d\u4ee4\uff0c\u5c31\u50cf\u5176\u4ed6\u5e38\u89c4\u5e94\u7528\u4e00\u6837\u3002\u4e0d\u662f\u5f88\u9177\u5417\uff1f<\/p>\n

\u5728 Windows \u4e2d\u4f7f\u7528 Linux \u547d\u4ee4<\/strong><\/div>\n

\u4f5c\u4e3a\u4e00\u4e2a\u70ed\u5fc3\u7684 Linux \u7528\u6237\u548c\u63a8\u5e7f\u8005\uff0c\u6211\u5e0c\u671b\u770b\u5230\u8d8a\u6765\u8d8a\u591a\u7684\u4eba\u4f7f\u7528\u201c\u771f\u6b63\u7684\u201d Linux\uff0c\u4f46\u6211\u77e5\u9053\u6709\u65f6\u5019\uff0c\u8fd9\u4e0d\u662f\u4f18\u5148\u8003\u8651\u7684\u95ee\u9898\u3002\u5982\u679c\u4f60\u53ea\u662f\u60f3\u7ec3\u4e60 Linux \u6765\u901a\u8fc7\u8003\u8bd5\uff0c\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u65b9\u6cd5\u4e4b\u4e00\u5728 Windows \u4e0a\u8fd0\u884c Bash \u547d\u4ee4\u3002<\/p>\n

1\u3001\u5728 Windows 10 \u4e0a\u4f7f\u7528 Linux Bash Shell<\/strong><\/span><\/div>\n

\u4f60\u662f\u5426\u77e5\u9053\u53ef\u4ee5\u5728 Windows 10 \u4e2d\u8fd0\u884c Linux \u53d1\u884c\u7248\uff1f\u00a0Windows \u7684 Linux \u5b50\u7cfb\u7edf \uff08WSL\uff09\u00a0\u80fd\u8ba9\u4f60\u5728 Windows \u4e2d\u8fd0\u884c Linux\u3002\u5373\u5c06\u63a8\u51fa\u7684 WSL \u7248\u672c\u5c06\u5728 Windows \u5185\u90e8\u4f7f\u7528\u771f\u6b63 Linux \u5185\u6838\u3002<\/p>\n

\u6b64 WSL \u4e5f\u79f0\u4e3a Bash on Windows\uff0c\u5b83\u4f5c\u4e3a\u4e00\u4e2a\u5e38\u89c4\u7684 Windows \u5e94\u7528\u8fd0\u884c\uff0c\u5e76\u63d0\u4f9b\u4e86\u4e00\u4e2a\u547d\u4ee4\u884c\u6a21\u5f0f\u7684 Linux \u53d1\u884c\u7248\u3002\u4e0d\u8981\u5bb3\u6015\u547d\u4ee4\u884c\u6a21\u5f0f\uff0c\u56e0\u4e3a\u4f60\u7684\u76ee\u7684\u662f\u8fd0\u884c Linux \u547d\u4ee4\u3002\u8fd9\u5c31\u662f\u4f60\u6240\u9700\u8981\u7684\u3002<\/p>\n

\"\"<\/p>\n

Ubuntu Linux inside Windows<\/em><\/p>\n

\u4f60\u53ef\u4ee5\u5728 Windows \u5e94\u7528\u5546\u5e97\u4e2d\u627e\u5230\u4e00\u4e9b\u6d41\u884c\u7684 Linux \u53d1\u884c\u7248\uff0c\u5982 Ubuntu\u3001Kali Linux\u3001openSUSE \u7b49\u3002\u4f60\u53ea\u9700\u50cf\u4efb\u4f55\u5176\u4ed6 Windows \u5e94\u7528\u4e00\u6837\u4e0b\u8f7d\u548c\u5b89\u88c5\u5b83\u3002\u5b89\u88c5\u540e\uff0c\u4f60\u53ef\u4ee5\u8fd0\u884c\u6240\u9700\u7684\u6240\u6709 Linux \u547d\u4ee4\u3002<\/p>\n

\"\"<\/p>\n

Linux distributions in Windows 10 Store<\/em><\/p>\n

\n

2\u3001\u4f7f\u7528 Git Bash \u5728 Windows \u4e0a\u8fd0\u884c Bash \u547d\u4ee4<\/strong><\/span><\/div>\n<\/p>\n

\u4f60\u53ef\u80fd\u77e5\u9053\u00a0Git\u00a0\u662f\u4ec0\u4e48\u3002\u5b83\u662f\u7531\u00a0Linux \u521b\u5efa\u8005 Linus Torvalds\u00a0\u5f00\u53d1\u7684\u7248\u672c\u63a7\u5236\u7cfb\u7edf\u3002<\/p>\n

Git for Windows\u00a0\u662f\u4e00\u7ec4\u5de5\u5177\uff0c\u80fd\u8ba9\u4f60\u5728\u547d\u4ee4\u884c\u548c\u56fe\u5f62\u754c\u9762\u4e2d\u4f7f\u7528 Git\u3002Git for Windows \u4e2d\u5305\u542b\u7684\u5de5\u5177\u4e4b\u4e00\u662f Git Bash\u3002<\/p>\n

Git Bash \u4e3a Git \u547d\u4ee4\u884c\u63d0\u4f9b\u4e86\u4eff\u771f\u5c42\u3002\u9664\u4e86 Git \u547d\u4ee4\uff0cGit Bash \u8fd8\u652f\u6301\u8bb8\u591a Bash \u7a0b\u5e8f\uff0c\u5982\u00a0ssh\u3001scp\u3001cat\u3001find\u00a0\u7b49\u3002<\/p>\n

\"\"<\/p>\n

Git Bash<\/em><\/p>\n

\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 Git Bash \u8fd0\u884c\u8bb8\u591a\u5e38\u89c1\u7684 Linux\/Bash \u547d\u4ee4\u3002<\/p>\n

\u4f60\u53ef\u4ee5\u4ece\u5176\u7f51\u7ad9\u514d\u8d39\u4e0b\u8f7d\u548c\u5b89\u88c5 Git for Windows \u5de5\u5177\u6765\u5728 Windows \u4e2d\u5b89\u88c5 Git Bash\u3002<\/p>\n

3\u3001\u4f7f\u7528 Cygwin \u5728 Windows \u4e2d\u4f7f\u7528 Linux \u547d\u4ee4<\/strong><\/span><\/div>\n

\u5982\u679c\u8981\u5728 Windows \u4e2d\u8fd0\u884c Linux \u547d\u4ee4\uff0c\u90a3\u4e48 Cygwin \u662f\u4e00\u4e2a\u63a8\u8350\u7684\u5de5\u5177\u3002Cygwin \u521b\u5efa\u4e8e 1995 \u5e74\uff0c\u65e8\u5728\u63d0\u4f9b\u4e00\u4e2a\u539f\u751f\u8fd0\u884c\u4e8e Windows \u4e2d\u7684 POSIX \u517c\u5bb9\u73af\u5883\u3002Cygwin \u662f\u7531 Red Hat \u5458\u5de5\u548c\u8bb8\u591a\u5176\u4ed6\u5fd7\u613f\u8005\u7ef4\u62a4\u7684\u81ea\u7531\u5f00\u6e90\u8f6f\u4ef6\u3002<\/p>\n

\u4e8c\u5341\u5e74\u6765\uff0cWindows \u7528\u6237\u4f7f\u7528 Cygwin \u6765\u8fd0\u884c\u548c\u7ec3\u4e60 Linux\/Bash \u547d\u4ee4\u3002\u5341\u591a\u5e74\u524d\uff0c\u6211\u751a\u81f3\u7528 Cygwin \u6765\u5b66\u4e60 Linux \u547d\u4ee4\u3002<\/p>\n

\"\"<\/p>\n

Cygwin<\/em><\/p>\n

\u4f60\u53ef\u4ee5\u4ece\u4e0b\u9762\u7684\u5b98\u65b9\u7f51\u7ad9\u4e0b\u8f7d Cygwin\u3002\u6211\u8fd8\u5efa\u8bae\u4f60\u53c2\u8003\u8fd9\u4e2a\u00a0Cygwin \u5907\u5fd8\u5f55\u6765\u5f00\u59cb\u4f7f\u7528\u3002<\/p>\n

4\u3001\u5728\u865a\u62df\u673a\u4e2d\u4f7f\u7528 Linux<\/strong><\/span><\/div>\n

\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f7f\u7528\u865a\u62df\u5316\u8f6f\u4ef6\u5e76\u5728\u5176\u4e2d\u5b89\u88c5 Linux\u3002\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u5728 Windows \u4e2d\u5b89\u88c5 Linux \u53d1\u884c\u7248\uff08\u5e26\u6709\u56fe\u5f62\u754c\u9762\uff09\u5e76\u50cf\u5e38\u89c4 Windows \u5e94\u7528\u4e00\u6837\u8fd0\u884c\u5b83\u3002<\/p>\n

\u8fd9\u79cd\u65b9\u6cd5\u8981\u6c42\u4f60\u7684\u7cfb\u7edf\u6709\u5927\u7684\u5185\u5b58\uff0c\u81f3\u5c11 4GB \uff0c\u4f46\u5982\u679c\u4f60\u6709\u8d85\u8fc7 8GB \u7684\u5185\u5b58\u90a3\u4e48\u66f4\u597d\u3002\u8fd9\u91cc\u7684\u597d\u5904\u662f\u4f60\u53ef\u4ee5\u771f\u5b9e\u5730\u4f7f\u7528\u684c\u9762 Linux\u3002\u5982\u679c\u4f60\u559c\u6b22\u8fd9\u4e2a\u754c\u9762\uff0c\u90a3\u4e48\u4f60\u53ef\u80fd\u4f1a\u5728\u4ee5\u540e\u51b3\u5b9a\u5207\u6362\u5230 Linux\u3002<\/p>\n

\"\"<\/p>\n

Ubuntu Running in Virtual Machine Inside Windows<\/em><\/p>\n

\u6709\u4e24\u79cd\u6d41\u884c\u7684\u5de5\u5177\u53ef\u5728 Windows \u4e0a\u521b\u5efa\u865a\u62df\u673a\uff0c\u5b83\u4eec\u662f Oracle VirtualBox \u548c VMware Workstation Player\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u4e24\u8005\u4e2d\u7684\u4efb\u4f55\u4e00\u4e2a\u3002\u5c31\u4e2a\u4eba\u800c\u8a00\uff0c\u6211\u66f4\u559c\u6b22 VirtualBox\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u8fd0\u884c Linux \u547d\u4ee4\u7684\u6700\u4f73\u65b9\u6cd5\u662f\u4f7f\u7528 Linux\u3002\u5f53\u9009\u62e9\u4e0d\u5b89\u88c5 Linux \u65f6\uff0c\u8fd9\u4e9b\u5de5\u5177\u80fd\u8ba9\u4f60\u5728 Windows \u4e0a\u8fd0\u884c Linux \u547d\u4ee4\u3002\u90fd\u8bd5\u8bd5\u770b\uff0c\u770b\u54ea\u79cd\u9002\u5408\u4f60\u3002<\/p>\n


\n

via:\u00a0https:\/\/itsfoss.com\/run-linux-commands-in-windows\/<\/a><\/p>\n

\u4f5c\u8005\uff1aAbhishek Prakash<\/a>\u00a0\u9009\u9898\uff1alujun9972<\/a>\u00a0\u8bd1\u8005\uff1ageekpi<\/a>\u00a0\u6821\u5bf9\uff1awxy<\/a><\/p>\n

\u672c\u6587\u7531\u00a0LCTT<\/a>\u00a0\u539f\u521b\u7f16\u8bd1\uff0cLinux\u4e2d\u56fd<\/a>\u00a0\u8363\u8a89\u63a8\u51fa<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5982\u679c\u4f60\u6b63\u5728\u8bfe\u7a0b\u4e2d\u6b63\u5728\u5b66\u4e60 shell \u811a\u672c\uff0c\u90a3\u4e48\u9700\u8981\u4f7f\u7528 Linux \u547d\u4ee4\u6765\u7ec3\u4e60\u547d\u4ee4\u548c\u811a\u672c\u3002 \u4f60\u7684\u5b66\u6821\u5b9e\u9a8c\u5ba4\u53ef […]<\/p>\n","protected":false},"author":323,"featured_media":98191,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-147145","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/147145","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\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=147145"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/147145\/revisions"}],"predecessor-version":[{"id":147245,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/147145\/revisions\/147245"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/98191"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=147145"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=147145"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=147145"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}