How to use the Win10 system Linux Bash command?

  
Microsoft has added Ubuntu Bash command support in the Win10 First Anniversary Update Preview. IT Home has also introduced how to install and enable the Win10 Linux Bash command. However, there are still users who are not likely to use it after opening. This time we will introduce the use of the Windows 10 version of the Bash command. The format is very simple and can be applied.

The specific method is as follows:
1, users who have not installed Bash can follow the method introduced earlier, first in the settings → update and security & rarr; for developers select "developer mode" Click to download "developer mode package", as shown below ——

But sometimes this package will not be downloaded successfully, the following figure appears ——

2 Don't worry at this time, if the previous step is not smooth, you can make up for it in the next steps. At this point, enter the control panel → program and function → enable or disable the Windows function, check the "Windows subsystem (Beta) for Linux", click "OK", install, as shown below — —

3. After installation, you need to restart, then open the command prompt and execute the following command to open it (you can open the Bash command directly in the administrator mode):
C:windowssystem32bash.exe
4. If the first step of the installation is not successful, you may need to download the required components from the store at this time. If you are successful or not, you must look at the network status. The IT home test encounters the following "Ghosts" situation:

5, as can be seen from the above figure, the user needs to create a Unix account during the download and installation process. Therefore, the account password must be set. In the process of entering the password, the password text is not visible. You need to enter it twice. After the setting is successful, you can use
6, the function command can be used to query bash --help. If you use it, you need to add “bash” in front, for example:
bash --debug
bash -- Init-file
bash --vers Ion

7. If you want to run Linux commands, you can use the following format (note the spaces between c and the leading quotation marks, as shown above):
bash -c "linux command"
For example:
bash -c "echo Hello from IThome"
bash -c "ls /mnt/c"
bash -c "lsb_release -a"

Copyright © Windows knowledge All Rights Reserved