Bash Scripting “Hello World”

  • Read
  • Discuss

Bash scripting is a powerful technique for automating tasks and customizing the behavior of various software tools on Unix-based systems. It allows users to write simple scripts to perform complex operations by combining commands and utilities already available on the system.

Bash scripts are interpreted by the bash shell, the default command-line interface on most Linux distributions. The bash syntax is straightforward, making it easy for users to learn and start writing their scripts. 

Let’s write our first Script!

  1. Open your terminal or shell.
  2. Create a new file using a text editor of your choice. For example, you can use the nano editor to create a file called “”:
  1. Type the following code into the file:

echo "Hello World"
  1. Save the file and exit the editor.
  2. Make the file executable by running the following command in the terminal:
chmod +x
  1. Finally, run the script by typing:

You should see the message “Hello World” printed in the terminal as shown in the screenshot below.

And that’s it! This is a simple example of how to write and run a Bash script. With this basic understanding, you can start exploring the capabilities of Bash scripts and automate various tasks on your system.

2 thoughts on “Bash Scripting “Hello World””

Leave a Reply

Scroll to Top