How to execute a bash file in terminal?

How do I execute a bash file in the terminal, after I created one?

simple type bash space and the file name
$ bash bar
$ sh bar
$ ./bar
if ur using ./ means ten u hav to change the premission chmod 755:D

the standard method for calling the shell for a script is to declare it in the first line of the file. Also called the shebang #!

file: demo.sh

#!/bin/bash
echo Hello, world!

Change the file to executable and run it from the terminal.

$ chmod +x demo.sh
$ ./demo.sh
Hello, world!