The shell is the Linux command line interpreter. It provides an interface between the user and the kernel and executes programs called commands. For example, if a user enters ls then the shell executes the ls command.
What does Shell do in Linux?
A Shell provides you with an interface to the Unix system. It gathers input from you and executes programs based on that input. When a program finishes executing, it displays that program’s output. Shell is an environment in which we can run our commands, programs, and shell scripts.
How does a shell execute a command?
The shell forks a child shell that automatically opens the file and begins to interpret it, one line at a time, as if each line is being typed on the shell’s standard input. This is why such a text file is called a shell script; it is literally a script of actions to be carried out by the subshell.