Announcement

Collapse
No announcement yet.

How to Install and Use Linux Bash Shell on Windows 11

Collapse
X
Collapse
  •  

  • How to Install and Use Linux Bash Shell on Windows 11

    Linux is a customizable, stable, and secure open-source operating system. It supports bash, which is a default command-line interface for most of the GNU/Linux systems. The full bash form is “Bourne Again Shell”, as it was developed to replace Bourne Shell with additional features. The advantage of using a bash shell is it executes human-readable commands, executes programs, and handles file systems.
    When using Windows, bash is a powerful tool to access Linux/UNIX commands and operations on Windows systems. You don’t have to install a virtual setup to run dual operating systems. Install WSL on Windows 11 and perform Linux commands and shell scripts within it.
    How to Install & Use Linux Bash Shell on Windows 11

    To access the bash shell on Windows 11, install WSL on the system. The process is quite simple & interesting, so there’s no need to worry.

    Launch Windows Terminal by right-clicking on the Windows icon and selecting Terminal (Admin). This will run the terminal application as administrator:



    After getting the terminal on screen, type in the following command to execute it and hit Enter:

    wsl --install




    The system will begin downloading and installing the relevant assets; this process may take several minutes.

    After the wsl installation, the installation process will continue to start downloading Ubuntu automatically and ask you to restart the system once it’s done:



    Next, the terminal will ask you to set credentials for the Linux default distro, Ubuntu. Ensure that you do not set the same Windows login Credentials; this should be different:





    Once the process is completed, Ubuntu will be launched.

    You’re not limited to Ubuntu distribution only. Other distributions can also be installed on Windows 11; just what distributions are available.

    To see the list of available distributions, run the following command in Windows Terminal:

    wsl --list --online




    You can easily install any other Linux distro on Windows Terminal by referring to the list available and using the command given below:

    wsl --install -d <distro_name>


    Replace the destro_name with the name of the Linux distribution that you want to install:

    wsl --install -d OracleLinux_9_1




    The process is the same as we did in the Ubuntu installation; you need to add credentials that differ from Windows login credentials.

    How to Launch Linux Distribution on Windows 11

    You have two options to launch the downloaded Linux distribution:

    Open the Windows Terminal through the Start menu and type the ubuntu command:

    ubuntu




    Alternatively, you can directly search it from the Windows Search bar by typing Ubuntu in it; select the Ubuntu app to launch it:



    How to Run Bash Shell on Windows 11

    Let’s run bash commands to check how it works to launch Linux Bash Shell on Windows 11.

    To display the list of all Linux commands that can be used in Bash Shell, execute the following command in the terminal:

    help -d




    Run the help command with the parameter in Linux Bash Shell to get the individual command details:

    help <parameter>


    How to Create a Bash Script File in Windows 11

    To create a bash file, the following process should be followed:

    Step 1: Open a text editor like Nano or any other tool to create a file:

    nano


    Step 2: Start writing the script:

    #! /bin/sh



    echo “Hello World”


    Save the file with the .sh extension by pressing the Control +X key and setting the file’s name like mybash.sh.

    Step 3: Open the Linux terminal and type the ls command to check if the file has been successfully created:



    How to Run Bash Script file in Windows 11

    To run bash scripting, launch the command prompt on the screen and enable Linux distro by typing ubuntu in it.

    Type the file name in the terminal and hit the Enter button:

    bash mybash.sh


    Conclusion

    Linux Bash Shell is the default command-line tool and a replacement for Bourne Shell. It is a powerful tool to run Unix operations on Windows without installing a virtual setup. Bash shell supports user-friendly commands; not only this, but you can also execute Unix tasks and manipulate files within it. To get it on Windows 11, we must install WSL first on Windows 11, and it will automatically download Ubuntu as the default distro of Linux. This article mentioned a detailed guideline for installing WSL on Windows 11 and how to launch it. Moreover, we have learned how to run a bash script file on Windows 11.





    More...
      Posting comments is disabled.

    Categories

    Collapse

    Article Tags

    Collapse

    There are no tags yet.

    Latest Articles

    Collapse

    • Advancing Xen on RISC-V: key updates
      by Kasimba
      At Vates, we are heavily invested in the advancement of Xen and the RISC-V architecture. RISC-V, a rapidly emerging open-source hardware architecture, is gaining traction due to its flexibility, scalability and openness, which align perfectly with our ethos of fostering open development ecosystems. Although the upstream version of Xen for RISC-V is not yet fully […]

      The post Advancing Xen on RISC-V: key updates appeared first on Linux.com.



      More...
      10-04-2024, 02:42 PM
    • Xen 4.19 is released
      by Kasimba
      Xen Project 4.19 has been officially out since July 31st, 2024, and it brings significant updates. With enhancements in performance, security, and versatility across various architectures like Arm, PPC, RISC-V, and x86, this release is an important milestone for the Xen community. Read more at XCP-ng Blog

      The post Xen 4.19 is released appeared first on Linux.com.



      More...
      10-04-2024, 02:42 PM
    • How to Set Up a Debian Development Environment
      by Kasimba



      by George Whittaker


      Setting up a development environment is a crucial step for any programmer or software developer. Whether you’re building web applications, developing software, or diving into system programming, having a well-configured environment can make all the difference in your productivity and the quality of your work. This article aims to guide you through the process of setting up a Debian development environment,...
      10-04-2024, 03:52 AM
    • Exploring Network Dynamics with NetworkX on Linux
      by Kasimba



      by George Whittaker


      Introduction

      In the age of data, understanding complex relationships within networks—ranging from social interactions to infrastructure systems—is more crucial than ever. Network analysis provides a set of techniques and tools for exploring these relationships, offering insights into the structure and dynamics of various systems. Among the myriad tools available, NetworkX emerges as...
      10-04-2024, 02:42 AM
    • Monthly News – September 2024
      by Kasimba
      Many thanks for your donations and for your support. Visual improvements in Cinnamon Within the team Joseph continues to work his magic. Bit by bit he’s improving the look and feel of the Cinnamon desktop. The new default theme landed on the master branch. It’s much darker and contrasted than before. Objects are rounded and […]

      More...
      09-30-2024, 01:40 PM
    • Unlock Your Creativity: Building and Testing Websites in the Ubuntu Web Development Playground
      by Kasimba



      by George Whittaker


      Introduction

      Ubuntu stands out as one of the most popular Linux distributions among web developers due to its stability, extensive community support, and robust package management. This article dives into creating a dedicated web development environment in Ubuntu, guiding you from the initial system setup to deploying and maintaining your websites.


      Setting Up Ubuntu for

      ...
      09-27-2024, 05:40 PM
    Working...
    X