How to Install and Use the Linux Bash Shell on Windows 10

Windows subsystem for Linux, introduced in anniversary update, became a stable feature in Fall composer update. Now you can run Ubuntu and OpenSUSE on Windows, Fedora and more Linux distributions are coming soon.


Install and Use the Linux Bash Shell on Windows 10
Linux on Windows Screenshot


What you should know about Bash Shell of Windows 10

This is not a compiled Linux software for virtual machines, containers or windows (like Cygwin). Instead, Windows 10 provides a full Windows subsystem for Linux to run Linux software. This is based on Microsoft's abandoned project Astoria work to run Android apps on Windows.

RELATED: Everything You Can Do With Windows 10's New Bash Shell

Think about it as the opposite of Wine. While alcohol allows you to run Windows applications directly on Linux, the Windows subsystem for Linux allows you to run Linux applications directly on Windows.

Microsoft works with Canonical, which provides an entire Ubuntu based base shell environment driven by this subsystem. Technically, this is not Linux. Linux's built-in OS kernel, and it's not available here. Instead, it allows you to open the bash and execute the exact same binary that you usually run on Ubuntu Linux. Free software purists often argue that the average Linux operating system should be called "GNU / Linux" because it is actually running a lot of GNU software on the Linux kernel. The bash you will open is actually all those GNU utilities and other software.

Although this feature was originally called "Bash on Ubuntu on Windows", it also allows you to run Zsh and other command line shells. It still supports other Linux distributions. You can choose OpenSUSE Leap or SUSE Enterprise Server instead of Ubuntu, and Fedora is also on its way.

Here are some limitations. It does not yet support background server software, and it will not officially work with graphical Linux desktop applications. Every command line application does not work, either because this feature is not perfect.


How to Install Bash on Windows 10

This feature does not work on the 32-bit version of Windows 10, so make sure you're using the 64-bit version of Windows. Even if you're still using a 32-bit version, it's time to switch to a 64-bit version of Windows 10.

Assume that you have 64-bit Windows, to start, turn on Control Panel> Programs>Turn Windows Features On or Off  Enable the "Windows subsystem for Linux" option in the list, and then click on the "OK" button.

Click "Restart Now" when you are prompted to restart your computer. The feature will not work until you reboot.


Windows Features On or Off
Windows Features On or Off Screenshit

Note:
When Fall Creator updates start with, you now have to enable Developer Mode in the Settings app to use this feature. You need to install it from the Windows Features window.


After restarting your computer, open Microsoft Store from the Start menu and search for "Linux" in the store. Click on "Get App" under the "Linux on Windows" banner.

Note: Starting with Fall Creator Update, you can no longer install Ubuntu by running the "bash" command. Instead, you need to install Ubuntu or other Linux distribution from the Store app.

You will currently see a list of each Linux distribution available in the Windows Store. As a Fall Creator Update, it includes Ubuntu, OpenSUSE Leap, and OpenSUSE Enterprise, with a promise that Fedora will soon come.

Update: Debian and Black are now available in the store, but are not listed here. Find "Debian Linux" or "Black Linux" to find and install them.

To install Linux distribution, click it, and then click on the "Receive" or "Install" button to install it like any other store app.

If you are not sure which Linux environment to install, then we recommend Ubuntu. This popular Linux distribution was the only option available, but other Linux systems are now available to those who have more specific requirements.

You can also install several Linux distributions and each will get their unique shortcuts. You can also run many different Linux distributions at a time in different windows.


How to use Bash Shell and install Linux software

Now you have to open a full command-line bash based on Ubuntu, or other Linux distribution that you have installed.

Since they are the same binary, if you can use Ubuntu's apt or apt-get commands to install software from Ubuntu repositories, then you are using Ubuntu. Just use whatever command you use on that Linux distribution. You will have access to all Linux command line software, although some applications may not work perfectly yet.

To open the Linux environment you have installed, just open the Start menu and search for the distribution you have installed. For example, if you have installed Ubuntu, then launch Ubuntu shortcut.

You can easily pinpoint this application shortcut on your Start Menu, Taskbar or Desktop for easy access.


pinpoint application shortcut
pinpoint application shortcut

The first time you launch the Linux environment, you are being asked to enter a UNIX username and password. They do not have to match your Windows username and password but Linux will be used within the environment.

For example, if you enter "bob" and "letmein" as your certificate, then your username will be "bob" in the Linux environment and the password you use inside the Linux environment "letmein" It does not matter what your Windows username and password are

You can launch your installed Linux environment by running wsl command. If you have multiple Linux distributions installed, you can select the default Linux environment that launches this command.

If you have Ubuntu installed, you can also run the ubuntu command to install it. For OpenSUSE Leap 42, use opensuse-42. For SUSE Linux Enterprise Server 12, use sles-12. These commands are listed in the Windows Store on every Linux distribution page.

You can still launch your default Linux environment by running Bash command, but Microsoft says it's deprecated. This means that the Bash command can stop working in the future.

If you are experiencing using a bash shell on Linux, Mac OS X, or other platforms, then you are right at home.

On Ubuntu, you have to prefix a command with pseudo to run it with root permissions. On the Unix platforms, the "root" user has full system access, such as "administrator" user on windows. Your Windows File System Bash is located in the shell / mnt / c in the environment.

Use the same Linux terminal command that you will use to use. If you are used with your DOS command at standard Windows Command Prompt, here are some basic commands that are common to both Bash and Windows:
  • Change directory: CD in Bash, CD or hideer in DOS
  • Directory list content: LS in Bass, DIR in DOS
  • Move or rename the file: MV in Bash, move to DOS and rename
  • Copy a file: Copy into CP, DOS in Bash
  • Delete a file: Erase in Bash, RL, in RM or DOS
  • Make directory: mkdir in bash, mkdir in dos
  • Use a text editor: edit in vi or nano, dos in bash

It is important to remember that except Windows, Bash is open and its Linux-friendly environment is case-sensitive. In other words, "File.txt" with capital letters is different from "file.txt" without capital.

For more instructions, consult our starting guide for the Linux Command Line and other similar identities of the Bash shell, Ubuntu Command line and Linux Terminal Online.

You must use the APT command to install and update Ubuntu environment software. Be sure to prefix these commands with pseudo, which runs them as root-equal to the Linux administrator. Here are the APT-received commands you will need to know:
  • Download updated information about available packages: Sudo apt update
  • Install an application package: Install sudo apt packagename (replace "packagename" with the package name.)
  • Uninstall an app package: Remove sudo apt packagename (replace "packagename" with package name.)
  • Search for available packages: Pseudo apt search term (replace "word" with the word you want to find package names and descriptions.)
  • Download and install the latest versions of your installed package: Sado Apt Upgrade

If you have installed a SUSE Linux distribution, you can use the zypper command to install the software.

After downloading and installing the application, you can type your name at the prompt, and then press Enter to run it. For more information check documentation of that particular application.


Bonus: Install Ubuntu Font For A True Ubuntu Experience

If you want a more accurate Ubuntu experience on Windows 10, you can also install Ubuntu fonts and enable it in the terminal. You do not need to do this, because the default Windows Command Prompt font looks great for us, but this is an option.

It looks like this:
To install the font, first download Ubuntu Font Family from Ubuntu's website. Downloaded Open the .zip file and locate the file "Ubuntumono-R.ttf" This is the Ubuntu Monospace font, which is the only used in the terminal. This is the only font you need to install.


Ubuntumono-R.ttf
Ubuntumono-R.ttf

Double-click "Ubuntu Mono-R.ttf" file and you will see a preview of the font. Click "Install" to install it on your system.

To become an alternative to the Ubuntu Monospace font console, you need to add a setting to the Windows Registry.

Open Registry Editor by pressing Windows + R on your keyboard, typing the regedit and then pressing Enter. Navigate to the following key or copy and paste it into the Registry Editor's address bar:


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont

Right-click in the right pane and select New> String Value. Enter new value 000 name.

Double click on the "000" string you created, and then enter Ubuntu as its value information as Mona.

On the Ubuntu window, right-click on the title bar, and then select the "Properties" command. Click on the "Font" tab and select "Ubuntu Mona" in the font list.


Ubuntu Mona Font Screenshot
Ubuntu Mona Font Screenshot

The installed software bash installed in the Bash shell is limited to shell. You can access these programs elsewhere in a command prompt, power shell or Windows, but only when you run bash -c commands.


Post a Comment

0 Comments