2 Ways to Install Bash on Windows
- April 7, 2023
- 0
Interpreters from Command line they are something that is usually associated with Linux, however their use in Windows has increased recently, mainly due to the rise of PowerShell
Interpreters from Command line they are something that is usually associated with Linux, however their use in Windows has increased recently, mainly due to the rise of PowerShell
Interpreters from Command line they are something that is usually associated with Linux, however their use in Windows has increased recently, mainly due to the rise of PowerShell and especially WSL, which allows you to run a complete Linux operating system inside Windows. Since this trend, although it does not go beyond professionals, enthusiasts and the curious, I will mention two uses bash inside Windows, but before I get into that I’d better explain a little about what Bash is.
Bash, which stands for Bourne-a shell againis the most widely used command interpreter among Linux distributions and for a long time it was also used by macOS, then OS X, but Apple decided to replace it with Zsh when the license changed from GPLv2 to GPLv3 because it is too restrictive for a company with a bitten apple. The person responsible for developing Bash is the GNU Project, which embodies the principles of free software and is responsible for many tools that are widely used across the spectrum of free software in general and Linux in particular.
Development of Bash began in 1988, and the first version was released the following year with the aim of providing the GNU operating system with a competent POSIX compliant command line interpreter. However, the project was suffocated by the development of its own kernel, which is Hurd, which was de facto abandoned for a long time, so that Linux eventually took its place, thus creating what many define as GNU. /linux .
Looking at its track record, it’s clear that Bash is a Unix-oriented and Unix-like shell, but that doesn’t mean it can’t be used, not without some “problems” on Windows. While it’s true that Microsoft did not hesitate to establish itself as the number one enemy of Linux and free software at the beginning of the century, things have changed a lot since Satya Nadella became CEO of the Redmond-based corporation.
WSL is a Windows Subsystem for Linux and an environment or feature that allows you to run a full Linux operating system on top of Windows without the need for a separate virtual machine or dual boot. Its creation aims to prevent developers from switching from Windows to Linux, seeing the use of the latter more prevalent in industries such as artificial intelligence. On the other hand, WSL is seen by its detractors as an “adopt, expand and die” maneuver by Microsoft.
At the desktop level WSL can be activated in Windows 10 and Windows 11and for that purpose the user has to open the old “control panel“, which you can find by typing its name into the Start menu search engine.
Once the old Windows control panel opens, you need to click on the section Programs.
After entering the Programs section, click on “Turn Windows features on or off“, a section that you can also access after opening “Programs and Features”.
After opening the window”Windows features“you have to scroll down until you find”Windows Subsystem for Linux”, which must of course be checked before you can click the Accept button. After the feature installation is complete, the system will ask for a reboot to complete the process.
WSL is already installed, but now you need to boot some Linux distribution to it. For this we resort to the version Ubuntu for the subsystem that can be obtained from the Microsoft Store. When you enter the Ubuntu page/tab in the store, just click the Get button to start the download and installation. Once the process is complete, Linux can be booted by clicking the Open button that should appear on the Microsoft Store page/tab, or by searching for Ubuntu in the Start menu.
After booting Ubuntu, the user can check the version bash command entry echo "${BASH_VERSION}"
which checks the version running in the system, or bash --version
, which allows you to check your own installed version of Bash. From there it is possible to start learning to use a command interpreter, with which it is also possible to create programs using shell scripts or shellscripting.
Another way to get Bash to work on Windows is via the Git for Windows, which gives the MING64 environment access to the aforementioned shell. In addition to Git Bash, the installer also offers the possibility to use OpenSSH, which is a well-known tool for remote access developed mainly by OpenBSD, and OpenSSL, a widely used cryptographic library in Linux.
Getting Git Bash starts by downloading the Git installer for Windows. After that, and as usual, you need to run it by double-clicking on it.
Since I left things as they were by default at the general levels, I will limit myself to revealing four steps that I thought were important. To start, I selected “Git from command lines and also from third-party software” (Git from the command line as well as from third-party software) in the step of setting the user environment PATH (Editing the environment PATH). Here, the first option “Use Git only from Git Bash” (Use Git only from Git Bash), should be enough if you just want to play around with the command line.
The next step I modified is the components where I selected more icons (more icons), check daily for Git for Windows updates (Check daily for Git for Windows updates) and add the Git Bash profile to the Windows Terminal ((New!) Add a Git Bash profile to Windows Terminal).
In the configure additional options step (Configure additional options) I chose to be enable symbolic links (Allow symbolic links)while I did not mark anything from the experimental possibilities.
After the installation process is complete git bash It will be available from the Windows Start menu. Once opened, the user will see that the MINGW64 shell is running, with which they can run Bash commands.
As we can see, there are several ways to use Bash on Windows, although currently the most natural is to use WSL. Originally created to run command-line tools, the subsystem has evolved to be able to run graphical applications. If the user needs to work with different interpreters at the same time, it would not hurt to resort to Windows Terminal.
While Bash is still the most popular shell on Linux, it has recently had to face competition from Zsh, which came standard on macOS thanks to the fact that it was released under the MIT license and could be used. on Windows via UnxUtils. There is also PowerShell, Microsoft’s powerful interpreter, which made its way to Linux and macOS after publishing its source code under the same MIT license, although Microsoft kept several letters that are exclusive to Windows.
Source: Muy Computer
Donald Salinas is an experienced automobile journalist and writer for Div Bracket. He brings his readers the latest news and developments from the world of automobiles, offering a unique and knowledgeable perspective on the latest trends and innovations in the automotive industry.