Hauv kev hloov kho qhov tseem ceeb ntawm Windows 10 version 1607, lub sijhawm tshiab rau cov kws tsim tawm tau tshwm sim - lub Ubuntu Bash plhaub, uas tso cai rau koj khiav, nruab Linux daim ntawv thov, siv bash scripts ncaj qha hauv Windows 10, txhua qhov hu ua "Windows Subsystem rau Linux". Hauv Windows 10 version 1709 Lub Caij Nplooj Ntoos Zeeg Tsim Tsho Hloov tshiab, peb Linux faib khoom twb dhau los rau nruab. Hauv txhua qhov teeb meem, yuav tsum muaj 64-ntsis system rau kev teeb tsa.
Cov kev qhia no yog hais txog yuav ua li cas rau nruab Ubuntu, OpenSUSE, lossis SUSE Linux Enterprise Server ntawm Windows 10 thiab qee qhov kev siv piv txwv ntawm qhov kawg ntawm kab lus. Nws tseem yuav tsum tau sau tseg tias nws muaj qee qhov kev txwv thaum siv bash ntawm Windows: piv txwv li, koj tsis tuaj yeem khiav cov ntawv thov GUI (txawm hais tias lawv qhia cov kev ua haujlwm siv X server). Ib qho ntxiv, bash cov lus txib tsis tuaj yeem ua tiav cov khoos kas Windows, txawm hais tias muaj kev nkag mus rau OS cov ntaub ntawv kaw lus.
Nruab Ubuntu, OpenSUSE, lossis SUSE Linux Enterprise Server ntawm Windows 10
Pib ntawm Windows 10 Lub Caij Nplooj Ntoos Zeeg Hloov Hloov tshiab (version 1709), kev teeb tsa ntawm Linux subystem rau Windows tau hloov me ntsis ntawm qhov nws tau ua dab tsi hauv cov ntawv dhau los (rau cov ua ntej, pib txij 1607, thaum lub luag haujlwm tau qhia hauv beta, kev qhia yog nyob rau hauv ntu thib ob ntawm cov ntawv no).
Tam sim no cov kauj ruam tsim nyog muaj raws li hauv qab no:
- Ua ntej tshaj plaws, koj yuav tsum qhib "Windows Subsystem for Linux" cov khoom hauv "Control Panel" - "Cov programs thiab Nta" - "Qhib Windows Features lossis qhib."
- Tom qab kev txhim kho cov Cheebtsam thiab rov pib kho lub khoos phis tawm, mus rau Windows 10 App Store thiab rub tawm Ubuntu, OpenSUSE lossis SUSE Linux ES los ntawm qhov ntawd (muaj, peb faib tau tam sim no). Thaum rub tawm, qee qhov nuances tuaj yeem ua tau, uas tau tham ntxiv hauv kev sau ntawv.
- Khiav cov ntaub ntawv rub xa tawm raws li daim ntawv thov Windows 10 thiab ua pib teeb tsa (siv tus username thiab password).
Yuav kom qhib tau lub Windows Subsystem rau Linux tivthaiv (thawj kauj ruam), koj tuaj yeem siv PowerShell lus txib:
Pab-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Tam sim no ob peb sau ntawv uas yuav pab tau thaum lub sijhawm teeb tsa:
- Koj tuaj yeem nruab ntau lub Linux faib rau tib lub sijhawm.
- Thaum rub tawm lub Ubuntu, OpenSUSE, thiab SUSE Linux Enterprise Server faib nyob rau hauv Lavxias-cov lus Windows 10 khw, Kuv pom cov nuance hauv qab no: yog tias koj tsuas sau lub npe thiab nias Enter, tom qab ntawv qhov xav tau tsis pom nyob hauv kev tshawb, tab sis yog tias koj pib ntaus ntawv thiab tom qab ntawd nyem rau qhov tshwm sim uas tshwm sim, koj tau txais nplooj ntawv xav tau. Hauv rooj plaub, ncaj qha cov kev txuas mus rau faib tawm hauv khw: Ubuntu, OpenSUSE, SUSE LES.
- Koj tseem tuaj yeem pib Linux los ntawm cov kab hais kom ua (tsis yog tsuas yog cov pobzeb hauv Start menu): ubuntu, opensuse-42 lossis sles-12
Txhim Kho Bash ntawm Windows 10 1607 thiab 1703
Txhawm rau nruab bash plhaub, ua raws li cov theem yooj yim no.
- Mus rau Windows 10 Chaw - Hloov tshiab thiab Ruaj Ntseg - Rau Cov tsim tawm. Qhib cov qauv tsim tawm (Internet yuav tsum txuas nrog rub tawm cov khoom tsim nyog).
- Mus rau ntawm cov tswj kav - Cov khoos kas thiab cov khoom siv - Qhib lub Windows qhov sib txuas los yog tawm, kos lub thawv "Windows Subsystem rau Linux"
- Tom qab kev txhim kho cov Cheebtsam, nkag mus "bash" hauv Windows 10 tshawb nrhiav, tua tawm cov ntawv thov uas tau thov thiab ua tiav kev teeb tsa. Koj tuaj yeem tsim koj lub npe thiab tus password rau bash, lossis siv tus neeg siv lub hauv paus tsis muaj tus password.
Thaum lub installation tiav lawm, koj tuaj yeem khiav Ubuntu Bash ntawm Windows 10 los ntawm kev tshawb nrhiav, lossis los ntawm kev tsim ib qho luv luv rau lub plhaub uas koj xav tau.
Piv Txwv Ubuntu Plhaub Windows
Yuav pib nrog, Kuv nco ntsoov tias tus sau tsis yog tus kws tshaj lij hauv bash, Linux, thiab kev tsim kho, thiab cov piv txwv hauv qab no tsuas yog ua qauv qhia tias hauv Windows 10 bash ua haujlwm nrog cov kev cia siab rau cov uas nkag siab qhov no.
Linux kev thov
Cov ntawv thov nyob rau hauv Windows 10 Bash tuaj yeem ntsia tau, tshem tawm, thiab kho tshiab siv apt-tau (sudo apt-get) los ntawm Ubuntu repository.
Siv cov ntawv thov siv raws li cov ntawv tsis txawv ntawm Ubuntu, piv txwv li, koj tuaj yeem nruab Git hauv Bash thiab siv nws li qub.
Ntawv sau Bash
Koj tuaj yeem khiav cov bash scripts nyob rau hauv Windows 10, koj tuaj yeem tsim lawv nyob hauv Nano phau ntawv editor muaj nyob hauv plhaub.
Bash scripts tsis tuaj yeem hu rau Windows program thiab cov lus txib, tab sis koj tuaj yeem khiav bash scripts thiab cov lus qhia los ntawm cov ntaub ntawv bat thiab PowerShell scripts:
bash -c "hais kom ua"
Koj tseem tuaj yeem sim khiav cov ntawv thov nrog graphical interface hauv Ubuntu Plhaub ntawm Windows 10, muaj ntau dua ib qho kev qhia hauv Is Taws Nem ntawm cov ncauj lus no thiab qhov tseem ceeb ntawm txoj kev yog siv Xming X Server los tso saib GUI daim ntawv thov. Txawm hais tias kev raug cai ntawm kev ua haujlwm nrog cov kev siv Microsoft no tsis tau hais tseg.
Raws li nws tau sau saum toj no, Kuv tsis yog hom neeg uas muaj peev xwm ua kom txaus siab rau qhov muaj nuj nqis thiab kev ua haujlwm ntawm kev hloov kho tshiab, tab sis kuv pom tsawg kawg ib daim ntawv thov rau kuv tus kheej: ntau yam kev kawm ntawm Udacity, edX thiab lwm yam muaj feem rau kev txhim kho yuav yooj yim dua mus, ua haujlwm nrog cov cuab yeej tsim nyog ncaj qha hauv bash (thiab cov kev kawm no feem ntau qhia ua haujlwm hauv MacOS thiab Linux bash davhlau ya nyob twg).