• Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Tech News, Magazine & Review WordPress Theme 2017
  • Tech
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    Exploring the Innovative Features of Pear Phones

    Exploring the Innovative Features of Pear Phones

    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    Master the World of Online Gaming with the Best Gaming VPN

    Master the World of Online Gaming with 3 Best Gaming VPN

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    5 Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

  • Crypto
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Business
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

No Result
View All Result
Geeky Insider
  • Tech
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Gear
    • All
    • Camera
    • Laptop
    • Smartphone
    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    The New Galaxy Watch Ultra and Galaxy Ring Are Announced by Samsung

    Exploring the Innovative Features of Pear Phones

    Exploring the Innovative Features of Pear Phones

    Latest Smart Home Gadgets for a Connected Life

    Latest Smart Home Gadgets for a Connected Life

    Eco-Friendly Products for Students

    Eco-Friendly Products for Students

    Essential Photography Equipment and Gadgets

    Mastering Your Shots: Essential Photography Equipment and Gadgets

    Level Up Your Game: Must-Have Gaming Gear!

    Level Up Your Game: Must-Have Gaming Gear!

    Trending Tags

    • Best iPhone 7 deals
    • Apple Watch 2
    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • iOS 10
    • iPhone 7
    • Sillicon Valley
  • Gaming
    Master the World of Online Gaming with the Best Gaming VPN

    Master the World of Online Gaming with 3 Best Gaming VPN

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    7 Powerful Strategies to Overcome Video Game Addiction and Reclaim Your Life

    Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    5 Powerful Ways Xbox Cloud Gaming is Revolutionizing the Gaming World

    9 Best Alternative Games Like Kahoot

    9 Best Alternative Games Like Kahoot

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    The Top 8 Free Bubble Shooter Games for Endless Entertainment

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

    Cloud Gaming Revolution: How Streaming is Changing the Future of Gaming

  • Crypto
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

  • Business
    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    How Drones and 360-Degree Cameras Are Changing Bridal Photoshoots

    120+ Best Creative Names for Team at Work

    120+ Best Creative Names for Team at Work

    Can You Repair Printed Circuit Board ?

    Mastering PCB Board Repair Comprehensive Guide

    Breaking Barriers Federal Inmate Texting Service

    Breaking Barriers Federal Inmate Texting Service

    transfer whatsapp from android to iphone

    How to Transfer WhatsApp from Android to iPhone!

    Understanding the Role of Humidity Chambers in Climate Testing

    Understanding the Role of Humidity Chambers in Climate Testing

    Everything You Get to Know About Movember Beard Memes

    Everything You Get to Know About Movember Beard Memes

    Best Book Recommendation Apps

    11 Best Book Recommendation Apps

    How to quickly divide or Split PDF files

    How to Quickly Divide or Split PDF Files

Submit
Geeky Insider
No Result
View All Result

How to Install and Use Bash on Windows 11

by Staff Writer
July 25, 2022
in Microsoft
Reading Time: 10 mins read
How to Install and Use Bash on Windows 11
Share on FacebookShare on Twitter

Table of Contents

Toggle
    • READ ALSO
    • What Are Windows Runtime Errors and How Do You Fix Them?
    • PC Game Performance Can Drop With Windows 11 22H2, Microsoft Warns
  • How to Install WSL and Bash on Windows 11
  • How to Launch Your Linux Distro and Use Bash
  • How to Run a Bash Script in Windows

READ ALSO

How to Fix the Printer Error “0x0000011b” on Windows

How to Fix the Printer Error “0x0000011b” on Windows

November 16, 2022
Microsoft announces new supply chain management tools

Microsoft announces new supply chain management tools

November 16, 2022

Bash (Bourne Again Shell) is the command line, and graphical user interface distributed with all Linux distributions. Using Bash on Windows 10 wasn’t a simple process. However, Windows 11 includes an upgraded Windows Subsystem for Linux (WSL 2.0) that allows you to install and use Bash easier than ever.

The new version of WSL runs a true Linux kernel inside of a virtual machine. This means that any Linux distribution you run under WSL includes Bash.

How to Install WSL and Bash on Windows 11

To install and run Linux operating systems that include Bash on your Windows 11 system, you’ll need to install WSL first. On Windows 11, this is a straightforward process using Windows Terminal. Do not launch CMD (Command Prompt) – Windows Terminal is a different application.

1. Select the Start button, and type “terminal” in the search field. In the Windows Terminal pane select Run as Administrator.

Note: If Windows Terminal doesn’t launch, you may need to update it. Visit the Microsoft Store and install the latest version of the Windows Terminal.

2. Type the following command: wsl –install, at the command prompt and press Enter. This single command will download and install the latest version of the Windows Subsystem for Linux. The download is a few hundred megabytes so the installation process may take some time to finish.

3. When it’s finished, you should see the message: “The requested operation is successful.” Once you see this message, restart your system to complete the WSL installation. You can type shutdown /r /t 0 in Windows Terminal to initiate the reboot.

4. After your system reboots, the process will continue by installing Ubuntu as the default Linux distro. You will be prompted to enter a username and password for the Linux system.

5. Once you’ve finished, Ubuntu will launch into the Bash shell automatically. You can use the same commands you would normally use in Linux, including installing Linux apps into this virtual environment.

6. You can install other Linux distros if you prefer. To see which ones are available to install, reopen Windows Terminal (Powershell), type wsl –list –online, and press Enter. You will see options like Opensuse, Debian, and others.

7. You can install any of these distros by typing wsl –install -d <<distro name>> into the Windows Terminal. The same process as the previous Ubuntu installation will repeat, and you’ll need to enter a username and password to complete the installation.

Note: You can also install any Linux Distro on Windows from the Microsoft Store.

How to Launch Your Linux Distro and Use Bash

There are two methods you can use to launch your Linux distro. If you installed Ubuntu, you can select the Start menu, type Ubuntu, and select the Ubuntu app to launch it.

Alternatively, you can launch the Windows Terminal and just type the command Ubuntu to launch the Linux Bash shell in the Ubuntu environment.

To see a list of all available Linux commands you can use in Bash, type help -d.

You can get more details about individual commands by typing help followed by the command name. For example, help printf returns command details and information about each command parameter.

Some of the more common Bash commands most people use when they first get started include:

  • Interactive Mode: Type commands into the command-line interface (Windows Terminal).
  • Batch Mode: Run a text file that contains all of the commands you’d like Linux to execute in order. Many people create these scripts using programming syntax.

How to Run a Bash Script in Windows

To run a script in Bash, just create a text file using your favorite file editor like Notepad and save it in a location you’ll remember.

One thing that’s unique about a Bash script is that the first line must be “#!” followed by the path of your Linux bash path. To see what that is, launch Ubuntu and type which bash into the command line window. This will provide the Bash path.

Create a new text file and include that first line at the top. In the case of this example, that would be:

#! /user/bin/bash

Follow this line with each sequential command you want Linux to run. In this example:

  • Line 1: Uses the echo command to display text to the user on the screen.
  • Line 2: Combines echo with the date command to return today’s date.
  • Line 3: Combines echo with the whoami command to return your user name.

Save this text file with a .sh extension. Remember the path to this file.

Next, open the Windows Terminal and use the cd command to navigate to the path where you’ve saved the Bash script.

To run the script, type bash <<name of script>>.

This is a very simple example, but this demonstrates how you can use such a file to craft entire Bash script programs. Even programming statements like IF statements are available to include decision-making capabilities in your script.

The site SS64 provides an extensive resource with all available Bash commands that you can use in the Bash terminal or your Bash scripts.

You can also see a tutorial on using a Linux shell script to back up a directory.

Source by helpdeskgeek.com

Related Posts

Get access to Microsoft Office for only $40
Microsoft

Get access to Microsoft Office for only $40

November 17, 2022
Ansys-Microsoft Solution Enables Electromagnetic Analysis of Entire Chip Designs
Microsoft

Ansys-Microsoft Solution Enables Electromagnetic Analysis of Entire Chip Designs

November 16, 2022
How to Fix the Printer Error “0x0000011b” on Windows
Microsoft

How to Fix the Printer Error “0x0000011b” on Windows

November 16, 2022
Microsoft announces new supply chain management tools
Microsoft

Microsoft announces new supply chain management tools

November 16, 2022

Recommended.

YouTube TV finally adds a feature that it should have had all along

YouTube TV finally adds a feature that it should have had all along

November 14, 2022
The Pixel 7 and Pixel 7 Pro in white.

Google Confirms Pixel 7 Pre-Order Date in New Teaser Video – Review Geek

September 21, 2022

Trending.

No Content Available
  • Home
  • About
  • Contact
  • Privacy
  • Terms
  • DCMA
  • Write For Us / Submit
Contact us for submission queries. editor[at]geekyinsider.com.
No Result
View All Result
  • Home
  • Review
  • Apple
  • Gaming
  • Gadget and Gear
    • Camera
    • Smartphone
  • Microsoft
  • Security