Windows 10 一週年更新引入 WSL(Windows Subsystem for Linux),讓使用者能在 Windows 原生環境執行 Ubuntu Bash。本文整理從啟用功能到常用指令的完整流程。
bash 或 C:\Windows\System32\bash.exe。




bash --help:顯示說明bash --debug:除錯模式bash --init-file <檔案>:載入初始化腳本bash --version:顯示版本
格式:bash -c "linux指令"(注意 -c 後有空格)。
bash -c "echo Hello from IThome"
bash -c "ls /mnt/c"
bash -c "lsb_release -a"
此方式適合在批次檔、排程工作中呼叫 Linux 工具,無需進入互動式 Shell。