In the field of Linux system administration, the shell is the main communication interface between the user and the operating system.
Any computer user interacts with the shell at some point.
Whether it appears in the form of tiny icons or in the form of a prompt that prompts you to type commands, the shell is the first interface an operating system offers to its users.
An operating system kernel is a function library that provides the user with a series of operations, called system calls.
Shell is a simple program that uses these operations to provide a first user interface.
The mission of a shell is to read commands from the user and then interpret and execute them. Commands are executed using system calls.
System calls are used to:
1. Write the message user (prompt);
2. Read the keys pressed by the user;
3. Ask the kernel to execute a command;
4. Wait for it to finish.
Notice that the shell does not write any results on the screen. The shell reads a command name, which it executes as a separate process. This process is the one that prints the results seen by the user. Shell is required to invoke or run various programs available on your computer. The most used shell is bash and along with the kernel, the shell is one of the main components of an operating system. Bash is a scripting language compatible with shell commands.
It can be executed either from the standard input or from a file. Bash Scripts are executable text files; these files can be edited with any text editor.
These scripts are used to execute simple or complex commands.
Unix text shells integrate a scripting language called shell script that contains a sequence of shell commands that can write real programs to automate system administration.
The syntax of this language is an extension of those used interactively.
In this way, a shell script is an essential tool for administrative tasks and other repetitive routines that do not require advanced programming language functionality.
In Windows, there is no separation between the terminal emulator and shell. In most versions of Microsoft Windows, the terminal emulator and the associated shell can be accessed by running cmd or command.
Text Shells are primarily used by experienced users because the commands to be introduced must be known.
Shell graph
With the graphical interface of the computer and its contents, it is no longer represented by text lines, but by icons and windows that allow for complex operations with a mouse.
Graphical Shells provide the means to manipulate graphical-based programs by allowing operations such as opening, closing, moving and resizing windows, making it easier to access.
Graphical interfaces can be included in desktop environments or can be provided separately. Linux, MacOS and Windows are examples of large-scale operating systems using graphics shells.
Notice that for the kernel, the shell is a process like all others, running without any privileges and occasionally making a system call.
Shells read commands from the user, then interpret them and turn them into a series of system calls, which generally culminate in the execution of one or more files.