Shell scripts

A shell script is a program that can be run in the Linux shell. Scripts are written in an interpreted language and consist of commands, functions and variables. These items are entered into a plaintext file that can then be run as a command.

Shell scripts in Linux are useful when you need to issue several commands to carry out a specific task. You don’t need to enter these command manually each time, one by one. Instead, you can create a script that contains all these commands.

Here is an example shell script:

linux example script

Because, by default, most Linux systems use bash, shell scripts are most often written in the bash shell scripting language. Other shell scripting languages (tcsh, ksh) are similar to bash.
Geek University 2022