Bash Scripting - How to Run Bash Scripting in Terminal Last Updated : 28 Nov, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we are going to see how to run bash script in terminal. For example, we create a bash file set of instructions or commands ( known as bash script ), and through command, we can run this file in terminal. Let see how to run bash script in terminal. Example 1 : In this example we print or echo some text on screen with the help of a terminal. $ echo "Geeks For Geeks" Output : Print the text using echo command Note : " echo" this command will display the text on screen. Example 2 : In this example, we print the date of command execution with the help of terminal. $ datePrint date using date command in terminal Example 3 : In this example, we will see that how to run a bash script file through a terminal. First, create a bash file named " welcome.sh " by the following command. $ touch welcome.sh Here, you can see that the file name is " welcome.sh ". Whenever you create a bash script file use ".sh " extension. Note : " touch " is used to create file. Now to write bash script, we should open this file in text editor using terminal. $ nano welcome.sh Note : " nano " is used to open file in text editor ( i.e. GNU nano ) Now, the text editor is opened. Write the following bash script into " welcome.sh " #!/bin/sh echo "Enter Your Name : " read name echo "Hello $name ! Welcome to our Geeks for Geeks site." Note : Where, #! : It is known as shebang./bin/sh : It is executable path of the system shell.read : It will read the data from user. Now, save and run this file using terminal. $ chmod +x ./welcome.sh $ ./welcome.sh Note : Where, chmod +x : It is used to make file executable../welcome : Here, "./" will run the bash script file. Output : Output Of above bash script Here, we can see clearly that how to run bash script in terminal. Comment More infoAdvertise with us Next Article Bash Scripting - How to Run Bash Scripting in Terminal thesahilrai Follow Improve Article Tags : Linux-Unix Bash-Script Similar Reads Bash Scripting - Working of Bash Scripting Bash Scripting is a crucial component of Linux's process automation. You can write a series of commands in a file and then execute them using scripting. A Bash script is a plain text file with a set of commands inside of it. These commands are a combination of ones we typically type on the command l 6 min read Bash Scripting - Introduction to Bash and Bash Scripting Bash is a command-line interpreter or Unix Shell and it is widely used in GNU/Linux Operating System. It is written by Brian Jhan Fox. It is used as a default login shell for most Linux distributions. Scripting is used to automate the execution of the tasks so that humans do not need to perform them 12 min read Bash Scripting - How to Initialize a String Strings are quite crucial aspects of programming and scripting. We need to store the characters in some variables. In this article, we'll see how to initialize strings in BASH. Basic String Initialization To initialize a string, you directly start with the name of the variable followed by the assign 2 min read How to Run Bash Script in AWS Lambda AWS Lambda is one of the strongest computing services in the serverless domain, via which developers can run their code without the need to provision or manage servers. Writing your code with AWS Lambda is key; AWS takes care of the needed infrastructure for running it. This makes it an excellent ch 7 min read How To Run Bash Script In Linux? Bash scripts, also called shell scripts, are programs that help automate tasks by storing a series of commands that often go together, like updates or upgrades. These scripts make it easier to perform tasks automatically instead of typing each command manually. After creating a Bash script, you can 6 min read How to run bash script in Python? If you are using any major operating system, you are indirectly interacting with bash. If you are running Ubuntu, Linux Mint, or any other Linux distribution, you are interacting with bash every time you use the terminal. Suppose you have written your bash script that needs to be invoked from python 2 min read Bash Scripting - Case Statement A case statement in bash scripts is used when a decision has to be made against multiple choices. In other words, it is useful when an expression has the possibility to have multiple values. This methodology can be seen as a replacement for multiple if-statements in a script. Case statements have an 8 min read How to Take Input in JavaScript in VS Code Terminal ? In JavaScript, capturing the user input through VScode Terminal can be done using various methods and approaches. These approaches are readline module, process.stdin, and process.argv. Table of Content Using readline moduleUsing process.argvUsing process.stdinUsing readline moduleIn this approach, w 2 min read Bash Scripting - Else If Statement In this article, we will discuss how to write a bash script for the Else If statement. Conditional statements: The statements that perform specific functions based on certain conditions are called conditional statements. In bash scripting, we have several conditional statements like IF, IF-ELSE, IF- 3 min read How to Run Bash Script in Github Actions ? GitHub Actions are helpful resources for coding. They automate processes in your GitHub projects, save you time and effort. It is possible that GitHub Actions will automate the steps involved in testing, deploying, and alerting users of your code. Because you can configure them to run at specified t 5 min read Like