[Windows 10] Windows call Linux; Linux call Windows command 撈埋用

本帖最後由 556556bt 於 2016-10-20 17:55 編輯

係最新既Windows 10 RS2 insider build 14951, WSL 加入左新既Windows Subsystem for Linux (WSL) features

  • First, they have added support for Ubuntu 16.04. Ubuntu 16.04 (Xenial) is installed for all new Bash on Ubuntu on Windows instances starting in build 14951 replacing Ubuntu 14.04 (Trusty).
  • Second, users can now launch Windows binaries directly from a WSL command prompt.

而最特別係可以係Windows Cmd call Linux cmd or 倒番轉都得. 什至係透過pipeline 混合使用都得

Cmd prompt 入邊call Linux cmd
eg: dir | bash -c "grep Video"


Bash Shell 入邊call notepad 直接open text file.
eg: /mnt/c/Windows/System32/cmd.exe /c notepad &


除左DOS cmd 之外, Liunx output 都可以同PowerShell InterOp


以下呢兩篇article 都有詳細介紹
Windows binaries can now be invoked directly from the WSL command line
https://mspoweruser.com/windows- ... e-wsl-command-line/
Windows and Ubuntu Interoperability
https://blogs.msdn.microsoft.com ... u-interoperability/

本帖最後由 556556bt 於 2016-10-20 17:46 編輯

WSL adds Ubuntu 16.04 Xenial support
https://blogs.msdn.microsoft.com ... -04-xenial-support/

就算upgrade 左 Windows Build 14591, 如果想用Ubuntu 16.04 Xenial 都要自己手動重安WSL 一次
係CMD/PS console 打

  • lxrun /uninstall /full
  • lxrun /install

check 下: lsb_release -a

TOP