User Tools

Site Tools


bash:hello_world

BASH - Hello World

Programmers often learn new languages via learning the hello world program. It’s a simple program that prints the string “Hello World” to the standard output.

Use an editor like vim or nano to create the file hello-world.sh and copy the below lines into it.

#!/bin/bash
echo "Hello World"

Save and quit the file.

You need to make this file executable using the below command.

chmod a+x hello-world.sh

You can run this using any of the below two commands.

bash hello-world.sh
./hello-world.sh

It will print out the string passed to echo inside the script.


bash/hello_world.txt · Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki