M'mbuyomu ya mawindo a Windows 10, tsamba 1607, mwayi watsopano wa omangawo unayambira - chipolopolo cha Ubuntu Bash, chomwe chimakupatsani kuthamanga, kuyika zolemba za Linux, kugwiritsa ntchito malemba pamwambidwe pa Windows 10, zonsezi zimatchedwa "Windows subsystem kwa Linux". Mu mawindo a Windows 10 1709 Ogwilitsika Ogwidwa, pali kale magawo atatu a Linux omwe angapezeke kuti asungidwe. Nthawi zonse, pulogalamu ya 64-bit ikufunika kuti muyike.
Phunziroli likufotokoza m'mene mungakhalire Ubuntu, OpenSUSE kapena SUSE Linux Enterprise Server pa Windows 10 ndi zina zogwiritsira ntchito kumapeto kwa nkhaniyo. Tiyeneranso kukumbukira kuti pali zoperewera pamene mukugwiritsa ntchito batch mu Windows: mwachitsanzo, simungayambe GUI ma request (ngakhale amalemba ntchito pogwiritsa ntchito seva X). Kuphatikiza apo, malamulo a bash sizingathetse mawindo a Windows, ngakhale kuti ali ndi mwayi wokhudzana ndi maofesi a OS.
Kuika Ubuntu, OpenSUSE, kapena SUSE Linux Enterprise Server pa Windows 10
Kuyambira pa Windows 10 Fall Creators Update (tsamba 1709), kukhazikitsa gawo la Linux la Windows lasinthika pang'ono kuchokera ku zomwe zinali m'matembenuzidwe apitalo (kwamasinthidwe apitalo, kuyambira pa 1607, pamene ntchitoyi inayambitsidwa mu beta, malangizo ali mu gawo lachiwiri la nkhani ino).
Tsopano njira zofunikira ndi izi:
- Choyamba, muyenera kuyika gawo la "Windows Subsystem kwa Linux" mu "Pulogalamu Yoyang'anira" - "Mapulogalamu ndi Zida" - "Kutsegula ndi Kutseka Windows Components".
- Pambuyo poika zigawozo ndi kubwezeretsanso kompyuta, pitani ku digolo la Windows 10 ndikuwongolera Ubuntu, OpenSUSE kapena SUSE Linux ES kuchokera kumeneko (inde, tsopano magawo atatu akupezeka). Mukamayika mazithunzi ena amatha, zomwe ziri m'ndandanda.
- Kuthamangitsani kugawa kumeneku monga mwachizolowezi mawindo a Windows 10 ndikupanga kukhazikitsa koyamba (dzina ndi dzina lanu).
Kuti mukhale ndi gawo la "Windows Subsystem kwa Linux" (sitepe yoyamba), mungagwiritse ntchito mphamvu ya PowerShell:
Thandizani -WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Tsopano zolemba zingapo zomwe zingakhale zothandiza panthawi yowonjezera:
- Mukhoza kukhazikitsa magawo angapo a Linux mwakamodzi.
- Pamene mukusindikiza kugawa kwa Ubuntu, OpenSUSE ndi SUSE Linux Enterprise Server m'sitolo la Windows 10 la Chirasha, ine ndinazindikira chiganizo chotsatirachi: Ngati mutangotchula dzina ndikukanikiza Enter, simapeza zotsatira zoyenera zofufuza, koma ngati mutayamba kulemba ndikudalira pazomwe zikuwoneka, mumangotenga tsamba lofunidwa. Momwemo, yongolerani zogawidwa m'sitolo: Ubuntu, tsegula, SUSE LES.
- Mungathenso kuthamanga Linux kuchokera ku mzere wotsogolera (osati kuchokera pa tile pomwe pali menyu yoyamba): ubuntu, opensuse-42 kapena zidutswa-12
Kuika Bash pa Windows 10 1607 ndi 1703
Kuyika chipolopolo cha bash, tsatirani njira zosavuta.
- Pitani ku magawo a Windows 10 - Update ndi chitetezo - Kwa omanga. Tembenuzani njira yokonza (intaneti iyenera kugwirizanitsidwa kuti imvetsetse zigawo zofunika).
- Pitani ku gawo lolamulira - Mapulogalamu ndi zigawo zikuluzikulu - Lolitsani kapena musiye Mawindo a Windows, Lembani "Windows pansi pa Linux".
- Pambuyo poika zigawozo, lowetsani "bash" mu mawindo a Windows 10, yambani ntchito yofunikirako yosiyana siyana ndikuyambitsa. Mukhoza kugwiritsa ntchito dzina lanu ndi mawu achinsinsi kwa bash, kapena mugwiritse ntchito wosuta popanda mawu achinsinsi.
Pambuyo pokonza, mutha kuthamanga Ubuntu Bash pa Windows 10 pogwiritsa ntchito kufufuza, kapena pangani njira yowonjezera ku chipolopolo kumene mukufunikira.
Zitsanzo za Ubuntu Shell mu Windows
Choyamba, ndizindikira kuti wolembayo si katswiri wa bash, Linux ndi chitukuko, ndipo zitsanzo zomwe ziri m'munsizi ndizisonyezero kuti mu Windows 10 bash amagwira ndi zotsatira zoyenera kwa iwo amene amvetse izi.
Ntchito za Linux
Mapulogalamu mu Windows 10 Bash akhoza kuikidwa, kuchotsedwa ndi kusinthidwa pogwiritsira ntchito bwino (sudo apt-get) kuchokera ku malo a Ubuntu.
Kugwiritsira ntchito mapulogalamu ndi zojambulazo sizinali zosiyana ndi zomwe pa Ubuntu, mwachitsanzo, mukhoza kukhazikitsa Git ku Bash ndikugwiritsa ntchito mwanjira yonse.
Bash scripts
Mukhoza kuthamanga malemba pa Windows 10, mukhoza kuwapanga m'nyuzipepala ya Nano yomwe ilipo mu chipolopolo.
Malemba a Bash sangathe kupempha mapulogalamu ndi maulalo a Windows, koma n'zotheka kuyendetsa malemba ndi malemba kuchokera ku ma fayilo ndi PowerShell malemba:
bash -c "lamulo"
Mungayesenso kuyambitsa mapulogalamu ndi mawonekedwe a Ubuntu Shell mu Windows 10, pali malangizo oposa limodzi pa nkhaniyi pa intaneti ndipo makamaka njirayi ikugwiritsira ntchito Xming X Server kuti iwonetse GUI ya ntchitoyi. Ngakhale mwachindunji kuthekera kwogwira ntchito ndi maofesi a Microsoft ngatiwo sikunalengezedwe.
Monga momwe zinalembedwera pamwambapa, sindine munthu amene angamvetsetse kufunika kwake ndi ntchito zake zatsopano, koma ndikuwona ntchito imodzi ndekha: maphunziro osiyanasiyana mu Udacity, edX ndi ena okhudzana ndi chitukuko zidzakhala zosavuta kugwira ntchito ndi zida zofunika bwino mu bash (ndipo pazimenezi ntchito imagwiritsidwa ntchito ku Macos ndi Linux bash).