Bash Scripting: Hello world

Sure! Here’s a simple “Hello, World!” example in Bash scripting:

echo "Hello, World!"

Let’s break down the script:

  • The first line #!/bin/bash is called the shebang and specifies the path to the Bash interpreter. It tells the system that this script should be executed using Bash.
  • The second line echo "Hello, World!" is the actual command in the script. echo is a command used to print text to the terminal. In this case, it prints the string “Hello, World!”.

To run this script:

  1. Open a text editor and copy the script into a new file. Save it with a .sh extension, such as
  2. Open a terminal or command prompt.
  3. Navigate to the directory where you saved the script.
  4. Make the script executable by running the command: chmod +x This grants the script execution permission.
  5. Finally, run the script by typing ./ and pressing Enter.

You should see the output Hello, World! printed in the terminal. Congratulations! You’ve successfully executed your first Bash script.

Leave a Comment

Your email address will not be published. Required fields are marked *