Chapter 2. Introducing the Shell

So, you can run commands at a prompt. But what is that prompt? Where does it come from, how are your commands run, and why does it matter?

That little prompt is produced by a program called a shell. It’s a user interface that sits between you and the Linux operating system. Linux supplies several shells, and the most common (and the standard for this book) is called bash. (See Appendix B for notes about other shells.)

Bash and other shells do much more than simply run commands. For example, when a command includes a wildcard (*) to refer to multiple files at once:

$ ls *.py
data.py    main.py    user_interface.py

the wildcard is handled entirely by the shell, not by the program ls. The shell evaluates the expression *.py and invisibly replaces it with a list of matching filenames before ls runs. In other words, ls never sees the wildcard. From the perspective of ls, you typed the following command:

$ ls data.py main.py user_interface.py

The shell also handles ...

Get Efficient Linux at the Command Line now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.