Getting Started with Bash
Tags: tutorial, beginners, programming, productivity
Published: 2022-04-13 06:21:05

In this article we are going to learn about what is bash and how we are going to install in windows? This is going to be a full series on Bash in which we are going to learn so much more.

According to Wikipedia,
>*Bash is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell.*

BASH is an acronym for Bourne Again Shell, It is a shell program written by Brian Fox as an upgraded version of Bourne Shell program '**sh**'. It was first released in 1989.

**Shell:** A UNIX Shell is a program or a command line interpreter that interprets the user commands which are either entered by the user directly or which can be read from a file and then pass them to the operating system for processing.

## Why Bash?
Bash Scripting is a powerful part of system administration and development used at an extreme level. People use Bash for  **system administration, data crunching, web application deployment, automated backups, creating custom scripts for various pages,** etc.  They can control their computer or OS without having to navigate menus, options, and windows within a GUI.

## What is Bash Script?
A Bash Shell Script is a simple and plain text file  that contains various commands that we usually type in the command line. It might include loops, functions, conditional constructs, etc. Effectively. In other words  ***Bash script is a computer program written in the Bash programming language.***

## Install Bash on Windows

### Method - 1
To run bash on windows you need to install it first to do that First Run you windows ***Powershell*** or ***Windows Terminal*** as *Administrator*, then run the following command-
```bash
wsl --install
```
This could take a few minutes because its size is several MB. after the downloading is done you need to restart your system after that It’ll start downloading and installing *Ubuntu*, and then you’ll be prompted to pick a username and password. They don’t have to be related to your Windows 11 login details. After that, all is done. Now you have installed `bash` in your system.
For futhuer info about this [Click Here](https://www.howtogeek.com/790062/how-to-install-bash-on-windows-11/)

### Method - 2
You can download and install [Ubuntu 20.04.4 LTS](https://www.microsoft.com/en-ms/p/ubuntu-20044-lts/9mttcl66cpxj?activetab=pivot:overviewtab) from Microsoft Store. Once its doen just open the Ubuntu Application then set username and password. And voilà your installation is done.  

## Running Bash
After the installation is done just open your windows terminal or ubuntu terminal (in windows) and run `bash` as shown in the image below-

![run bash](https://i.imgur.com/kvfTy4d.png)

**Note-** You can skip this step if you are a Mac or Linux user.

## Hello, World
Now we are going to run out the first command or program in bash. just type the following in your terminal.
```bash
echo "Hello, World"
# Output : Hello, World
```
![helloworld](https://i.imgur.com/HMhlTHE.png)

**echo:** It is a built-in command in Bash, which is used to display the standard output by passing the arguments. It is the most widely used command for printing the lines of text/String to the screen.

![preview](https://i.imgur.com/H6Pn30L.gif)

As you can see in the above gif you don't even need `""` to print something on-screen you can simply type `echo` followed by the text you want to print. You can create a file to do the same. That's for another article.

## Wrapping up
In this article we have learned that what bash is? why we wanna use it? How to Install `ubuntu` in windows and a simple `echo` command to print something on the screen. This is just begenning we are going to dive into the ocean of bash. For that stay tuned. it's going to be a bash series where we are going to explain various types of topic in the future articles. If you enjoyed this article then don't forget to press ❤️. If you have any queries or suggestions don't hesitate to drop them. See you.