Win10版Linux Bash命令使用教程
时间:2022-09-21 02:15:22
微软在Win10一周年更新预览版中加入了Ubuntu Bash命令支持。不过还是有用户在开启后不太会用,这次我们就介绍一下Win10版Linux Bash命令使用教程,格式很简单,套用就好。
![Win10版Linux Bash命令使用教程](https://img.aspxhome.com/file/2023/5/a314839_0.jpg)
具体方法如下:
1、没安装Bash的用户可以按照之前介绍的方法,先在设置→更新和安全→针对开发人员中选择“开发人员模式”,点击后会下载“开发人员模式包”,如下图 ——
![Win10版Linux Bash命令使用教程](https://img.aspxhome.com/file/2023/5/a314839_1.jpg)
但有时这个包会下载不成功,出现如下图提示——
![Win10版Linux Bash命令使用教程](https://img.aspxhome.com/file/2023/5/a314839_2.jpg)
2、此时也无需担心,上一步如果不顺利,可以在后续步骤中弥补。此时进入控制面板→程序和功能→启用或关闭Windows功能,勾选“适用于Linux的Windows子系统(Beta)”,点击“确定”后安装,如下图——
![Win10版Linux Bash命令使用教程](https://img.aspxhome.com/file/2023/5/a314839_3.jpg)
3、安装后需要重启,然后打开命令提示符,执行如下命令即可开启(可直接在管理员模式下输入Bash命令开启):
C:windowssystem32ash.exe
4、如果第一步安装不顺利,此时可能就需要从商店下载所需组件,顺利与否还得看网络状况,小编测试中就遇到如下“鬼畜”情况:
![Win10版Linux Bash命令使用教程](https://img.aspxhome.com/file/2023/5/a314839_4.jpg)
5、由上图可见,下载安装的过程中需要用户创建Unix账户,因此要设定账户密码,在输入密码的过程中,密码文字不可见,需要输入两遍,你心里要有数,设置成功后就可以使用了
6、功能命令可用bash --help来查询,在使用的话要在前面加上“bash”,例如:
bash --debug
bash --init-file
bash --version
![Win10版Linux Bash命令使用教程](https://img.aspxhome.com/file/2023/5/a314839_5.jpg)
7、如果要运行Linux命令,可采用如下格式(注意 c 和前引号间的空格,如上图):
bash -c “linux命令”
例如:
bash -c “echo Hello from IThome”
bash -c “ls /mnt/c”
bash -c “lsb_release -a”
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
win10平板模式怎么用_win10平板模式的使用方法
![](https://img.aspxhome.com/file/2023/3/a293806_0s.jpg)
如何用wps替换回车符 以及如何用其他符号替换换行符
![](https://img.aspxhome.com/file/2023/7/a169607_0s.jpg)
Win10系统Steam错误代码118是怎么回事?
![](https://img.aspxhome.com/file/2023/26/a222123_0s.jpg)
PPT图表美化教程 PPT图表变形计:简单几步让图表变好看!
![](https://img.aspxhome.com/file/2023/10/a351811_0s.png)
Win7重装系统会丢失文件吗?石大师无损重装系统Win7步骤
![](https://img.aspxhome.com/file/2023/1/a275215_0s.png)
Surface Pro 4:Win10正式版前推出无望
![](https://img.aspxhome.com/file/2023/4/a309591_0s.jpg)
IF函数的单条件用法
![](https://img.aspxhome.com/file/2023/7/a167487_0s.png)
怎么让PPT在演讲时发挥重要作用
Windows10版本2004任务栏的图标单击无反应的解决方法
![](https://img.aspxhome.com/file/2023/3/a294505_0s.jpg)
在Word中标尺的设置诀窍
![](https://img.aspxhome.com/file/2023/4/25004_0s.jpg)
驾校一点通怎么查看和重做答错的题目
![](https://img.aspxhome.com/file/2023/9/a341457_0s.png)
Mac磁盘怎么优化空间?Mac磁盘优化空间教程
![](https://img.aspxhome.com/file/2023/2/a215662_0s.jpg)
云图TV怎么观看直播回放 云图TV观看直播回放的教程
![](https://img.aspxhome.com/file/2023/8/a336973_0s.png)
Excel中怎么进行搜索筛选
![](https://img.aspxhome.com/file/2023/6/a153916_0s.png)
使用imessage群发短信mac验证码无法显示收不到
![](https://img.aspxhome.com/file/2023/7/a215107_0s.jpg)
如何把竖版word打印为横版?
![](https://img.aspxhome.com/file/2023/0/19120_0s.jpg)
win11推送预览版要怎么获取?
![](https://img.aspxhome.com/file/2023/5/a316124_0s.jpg)
在Paw中如何处理Cookie
![](https://img.aspxhome.com/file/2023/0/a211280_0s.png)
在word中如何调整页面
Win10安装Steam后提示无法联网更新怎么解决
![](https://img.aspxhome.com/file/2023/1/a281052_0s.jpg)