Yuav ua li cas khiav Bash Command Line hauv Windows 10

Cov txheej txheem:

Yuav ua li cas khiav Bash Command Line hauv Windows 10
Yuav ua li cas khiav Bash Command Line hauv Windows 10
Anonim

Yuav Paub

  • Ua kom WSL ua qhov xaiv Windows feature lossis los ntawm PowerShell hais kom ua.
  • Mus rau Windows Store. Xaiv ib qho kev faib tawm thiab nruab nws.
  • Khiav kev faib tawm thiab hloov kho yog tias xav tau. Siv nws los khiav bash scripts lossis Linux hais kom ua kab utilities.

Kab lus no piav qhia yuav ua li cas qhib, rub tawm, nruab thiab siv Windows Subsystem rau Linux (WSL) hauv Windows 10.

Yuav ua li cas khiav WSL hauv Windows

Nyob rau hauv Windows 10 Ib Xyoo Hloov Kho, Microsoft ntxiv Windows Subsystem rau Linux rau Windows 10 thiab txawm tias muaj (hauv kev koom tes nrog Canonical) ua haujlwm tau zoo ntawm Ubuntu Linux-ua haujlwm, tsuas yog lub plhaub nkag, txawm hais tias nws siv peb li. nanoseconds rau tib neeg kom paub seb yuav ua li cas khiav Linux apps hauv X ntu ntawm Windows 10.

Lub khw Microsoft muab kev txhawb nqa Linux faib rau Ubuntu, openSUSE Leap, SUSE Linux Enterprise, Debian / GNU Linux, thiab Kali Linux. Txhua qhov kev faib tawm no muaj cov kab hais kom nkag mus rau Linux, uas koj tuaj yeem khiav bash scripts lossis Linux command-line utilities.

Ua kom WSL

Image
Image

Los ntawm lub neej ntawd, koj siv tsis tau WSL. Hloov chaw, koj yuav tsum qhib WSL ua qhov xaiv Windows feature. Ob leeg qhib qhov Windows Features wizard thiab khij lub npov lossis qhib PowerShell kom raws li tus thawj tswj hwm thiab ua tiav:

Pab-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Reboot tom qab koj qhib WSL.

Nruab kev faib tawm

Image
Image

Xaiv lub Windows Store thiab xaiv ib qho kev faib rau nruab.

Khiav Kev Tshaj Tawm Thawj zaug

Image
Image

Tom qab kev faib khoom thauj mus rau hauv koj lub computer los ntawm Windows Store, khiav nws. Koj yuav tau tsim ib tus neeg siv nyiaj tshiab ib yam li yog tias koj tau teeb tsa kev faib khoom raws li kev ua haujlwm ib leeg ntawm lub hard drive tshiab.

Txhim kho koj qhov kev teeb tsa

Image
Image

Koj qhov kev faib tawm Linux tsis yog qhov ua piv txwv ib puag ncig-nws yog qhov tseeb Linux system uas siv WSL es tsis yog tus qauv kernel duab. Yog li koj yuav tsum tau mus koom nrog kev tu tsev hauv Linux ib txwm.

Pib nrog hloov kho qhov kev faib tawm raws li qhov system cov qauv. Piv txwv li, Debian thiab Ubuntu siv apt.

Siv Ib Txoj Haujlwm Kab hais kom ua

Image
Image

Tom qab koj tau hloov kho qhov kev faib tawm kom raug, koj tuaj yeem khiav txhua yam kev pab cuam uas koj xav tau-xws li cov ntawv plhaub thiab cov khoom siv kab hais kom ua.

Piv txwv li, koj tuaj yeem ua qhov top hais kom kuaj xyuas qhov system ua haujlwm.

Technically, koj tsis tuaj yeem khiav Linux cov kev pabcuam uas xav tau X server, txawm hais tias hauv is taws nem muaj littered nrog kev ua haujlwm ncaj ncaj kom tau Windows 10 los tso saib X windows.

Dab tsi nyob hauv qab hood?

Thaum koj nruab Linux faib rau Windows 10 koj tsis tau txais lub tshuab virtual lossis ib qho kev pab cuam uas ua qhov zoo tshaj plaws los ua tus "Bash hauv Linux." Nws yog qhov tseeb Linux faib ua haujlwm ib txwm nyob ntawm koj lub PC ua tsaug rau Windows Subsystem rau Linux. WSL yog "cov ntses zais cia" uas tso cai rau Linux software khiav ntawm Windows. Hauv qhov tseeb, WSL hloov lub Linux ntsiav; Linux ua haujlwm tag nrho raws li qhov xav tau, nws tsuas yog siv WSL ntau dua li cov duab Linux ntsiav li niaj zaus.

Pom zoo: