How to open bash files with terminal? [duplicate]

To edit:

Use any editor you like:

gedit some_file.sh
nano  some_file.sh
vim   some_file.sh
# ...

To run:

Either make it executable and run it giving the path:

chmod +x some_file.sh
./some_file.sh

Or tell bash to run it:

bash some_file.sh

Also see: How to run scripts without typing the full path?


Give it permission to run

chmod +x /path/to/yourscript.sh

And run your script:

/path/to/yourscript.sh