Page 32 - Raspberry Pi as a Foundation for Boosting Computer and Technology Literacy
P. 32
3 Fundamentals of the Linux system and terminal usage
we will conclude this section with a couple of guided projects that fo-
cus on customization.
3.1 Shell, terminal, and command line interface 3.1
At the beginning, it is crucial to distinguish between three concepts
that are frequently confused.
A shell serves as an interface between the user and the Linux kernel,
receiving and interpreting user commands before forwarding them to
the kernel for execution. These commands can consist of the shell’s
built-in features, shell scripts, or other programs (e.g. GNU core util-
ities).
Many Linux systems, including the Raspberry Pi OS, come with two
shells: sh and bash. Bourne shell, or sh, was originally developed for
early Unix versions and is required for the proper functioning of a Li-
nux system (Ward 2021, 12) and compatibility. At this time, howev-
er, sh is outdated and is simply a link to another shell on the system
(dash, in our case). Commands for the ‘sh-type’ shells are expressed
in the Shell Command Language, ensuring adherence to the POSIX
standard.
The Bourne-again shell (GNU Project 2020a), or bash, is a default
shell compatible with sh and is also POSIX-compliant. However, the
bash shell includes a superset of features compared to sh, such as
command history, tab completion, arrays, dictionaries, enhanced
arithmetic operations, command line editing, and more. In the mon-
ograph, we will mostly focus on bash, for it is the default and wide-
spread shell.
In Linux, a shell can be accessed in a variety of ways, including
through terminal emulators (Figure 3.1) and virtual consoles (TTYs).
The primary difference between the two lies in their operating envi-
ronments. A terminal emulator runs within a graphical environment,
Figure 3.1
Icon of a terminal emulator in the Raspberry Pi
OS panel
32