How to use bash to run a file listet with simple commands

you can make a shell script with those commands, and then chmod +x <scriptname.sh>, and then just run it by

./scriptname.sh

you can also just run it with a shell, for example:

bash example.txt
sh example.txt

Its very simple to write a bash script

Mockup sh file:

#!/bin/sh
sudo command1
sudo command2 
.
.
.
sudo commandn

Skriv et svar