how to run linux command with a script code example
Example 1: linux script to run commands
#1. Open the terminal. Go to the directory where you want to create your script.
#2. Create a file with . sh extension.
#3. Write the script in the file using an editor.
#4. Make the script executable with command
chmod +x <fileName>.
#5. Run the script using
./<fileName>.
Example 2: ubuntu run a shell script
$ ./script_name.sh
// if it need sudo permission the type:
$ sudo ./script_name.sh