Quantcast
Channel: CodeSection,代码区,Linux操作系统:Ubuntu_Centos_Debian - CodeSec
Viewing all articles
Browse latest Browse all 11063

The Ubuntu Sub System (New Bash Shell) in Windows 10

$
0
0

windows 10 has recently added aBash Shell support. It is not just a simple shell. It contains a complete linux subsystem, which means you can run Linux native code directly on Windows.

How to Enable Bash Shell on Windows 10?

Click the start and type in “Turn Windows Features on/off” and hit return. Alternatively, you can go to Control Panel and navigate to Programs, Turn Windows Features On/Off. Both methods should give you this dialog.

Enable Ubuntu at Windows 10 via Turn Windows Feature On/Off

Scroll down and tick “Turn Linux Subsystem (Beta)”. It takes a few minutes before the Linux shell is made ready.

install-bash-on-windows-10

How to Disable/Remove Bash Shell on Windows 10?

If you decide to remove theLinux Shell on Windows, here is how you should type in the following command in the Windows Cmd Prompt:

lxrun /uninstall /full How to Change Default User on Bash Shell Windows?

At the very first time after setup, you are prompted a default user and set the password. You could change this later so that every time you open the bash shell, the default user is logged in.

lxrun /setdefaultuser root

The above command sets root account by default.

How to Install Software on Bash Shell Windows?

The answer is apt-get package manager. Basically the user experience is almost exactly the same as on the true Ubuntu OS. Let’s see below screenshot that I run the sudo apt-get install g++ to install the g++ compiler on the Linux Sub System.

apt-get-install-on-windows

These commands are also working exactly as expected:

apt-get update apt-get autoremove apt-get upgrade apt-get dist-upgrade

apt-get update apt-get autoremove apt-get upgrade apt-get dist-upgrade

It is more than a Shell

The most frequently daily Linux commands are supported quite well on this Linux sub system.

bash-on-windows-some-command

The Vim Editor seems working well.

bash-vim-editor

htop (sudo apt-get install htop) to show my powerHPZ800 server.

htop-on-bash-shell-windows

File/Directory Structure

The Bash Shell on Windows 10 has exactly the Linux File/Directory Structures e.g. /, /root, /home, the one root tree-like structure where everything is basically a file and can be mounted/dismounted.

bash-shell-directory-structure

The files in Windows C drive can be accessed at /mnt/c/ and the files in Windows D drive can be accessed at /mnt/d/ etc… Don’t worry, these are already set up for you so basically you don’t need to worry about configuring it.

No GUI/Graphic Applications yet

Unfortunately, only theconsole applications are supported in this shell, that means that you can’t start e.g. xstart GUI or playing a 3D game.

What is this Bash Shell for?

Bash Shell is not going to replace the TraditionalCMD Shell. Neither the Bash Script is going to replace the Windows Batch or PowerShell. Bash Shell on Windows provides a handy tool for Linux lovers while they have to use Windows e.g. for Work.

Admit it or not,Linux shell is very powerful and basically it has no rivals when it comes to data processing, multitasking, programming, and so many more. Linux Bash Shell is not just a shell, but a entire complete programming language/environment.

Where there is a shell, there is a way!

The Permanent URL is:.- Support my work via Donations (Thanks):

:


Viewing all articles
Browse latest Browse all 11063

Trending Articles