windows10 linux 开了,Win10使用进阶 开启Linux Bash命令行(这是个完整的 Linux 系统)...

Windows10 在最新的系统版本中包含了大部分已宣布内容,其中就包括重要的原生支持Linux Bash命令行支持。

基本信息

微软已经向windows insider用户推送了windows10 该新版本的windows10中内置了linux子系统!

测试时间:2016 09 13

Windows10测试系统版本: Windows1010.0.14393.103

Linux子系统版本:Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com)

(gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014

使用方法:安装完成后

方式一:直接在 CMD 输入 bash 就进入到 Linux 命令行环境

方式二:在不进入到Linux 命令行环境 可以这么调用 bash -c “ls /mnt/c” (注意 c 和前引号间的空格)

特点:Windows文件系统映射到了Linux,因此Linux子系统可随意访问Windows文件系统的文件和目录

开启方法

1.打开系统设置->更新和安全->针对开发人员->选择开发者模式。

2.控制面板->程序->启用或关闭windows功能,

3.找到windows subsystem for linux,勾选安装

如果没有这一项 请自行 更新win到最新版本

1f4c997e95f8d3d3cdda99d897c35e42.png

4.重启电脑 (过程会非常的快,因为仅仅是变更了部分设置而已)

4fa30057c678fa6cd3db5aeecb4eca29.png

5.打开CMD 输入 C:\windows\system32\bash.exe 安装

Microsoft Windows [版本 10.0.14393]

(c) 2016 Microsoft Corporation。保留所有权利。

C:\Users\jiang>C:\windows\system32\bash.exe

-- Beta 版功能 --

这将在 Windows 上安装由 Canonical 分发的 Ubuntu,

根据其条款的授权参见此链接:

https://msdn.microsoft.com/en-us/commandline/wsl/user_support

键入“y”继续: y

正在从 Windows 应用商店下载... 100%

正在提取文件系统,这将需要几分钟的时间...

请创建默认的 UNIX 用户帐户。该用户名不需 要与 Windows 用户名匹配。

有关详细信息,请访问: https://msdn.microsoft.com/en-us/commandline/wsl/user_support

请输入新的 UNIX 用户名:

root

找到 UNIX 用户: root

安装成功!

环境将立即启动...

文档在以下网址提供: https://www.ubuntu.com/about/about-ubuntu/licensing

root@小江:/mnt/c/Users/jiang#

6.安装完成

使用 方法

1.直接在 CMD 输入 bash 就进入到 Linux 命令行环境

2.在不进入到Linux 命令行环境 可以这么调用 bash -c “ls /mnt/c” (注意 c 和前引号间的空格)、

3.输入 C:\windows\system32\bash.exe 进入Linux

脚本 以及 应用安装测试

安装 Linux htop

root@小江:/mnt/c# apt-get install htop

Reading package lists... Done

Building dependency tree

Reading state information... Done

The following packages were automatically installed and are no longer required:

libfreetype6 os-prober

Use 'apt-get autoremove' to remove them.

The following NEW packages will be installed:

htop

0 upgraded, 1 newly installed, 0 to remove and 56 not upgraded.

Need to get 68.0 kB of archives.

After this operation, 188 kB of additional disk space will be used.

Get:1 http://archive.ubuntu.com/ubuntu/ trusty/universe htop amd64 1.0.2-3 [68.0 kB]

Get:2 http://archive.ubuntu.com/ubuntu/ trusty/universe htop amd64 1.0.2-3 [68.0 kB]

Get:3 http://archive.ubuntu.com/ubuntu/ trusty/universe htop amd64 1.0.2-3 [68.0 kB]

Fetched 66.1 kB in 4min 52s (226 B/s)

Selecting previously unselected package htop.

(Reading database ... 24997 files and directories currently installed.)

Preparing to unpack .../htop_1.0.2-3_amd64.deb ...

Unpacking htop (1.0.2-3) ...

Processing triggers for mime-support (3.54ubuntu1.1) ...

Processing triggers for man-db (2.6.7.1-1ubuntu1) ...

Setting up htop (1.0.2-3) ...

root@小江:/mnt/c# htop

root@小江:/mnt/c# htop

root@小江:/mnt/c# apcat /proc/version

Linux version 3.4.0-Microsoft (Microsoft@Microsoft.com) (gcc version 4.7 (GCC) ) #1 SMP PREEMPT Wed Dec 31 14:42:53 PST 2014

root@小江:/mnt/c#

win 下面的各种shell 集合

6b9dd0156a15b545b4aae25f848906d5.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值