Shell/The Shell

From Coder Merlin
< Shell
Revision as of 10:18, 23 November 2021 by Guanyu-su (talk | contribs) (Created page with "== The Shell == A shell is a user interface which provides access to an operating system’s services. There are two basic types of shells: a “command-line interface” (CLI...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

The Shell[edit]

A shell is a user interface which provides access to an operating system’s services. There are two basic types of shells: a “command-line interface” (CLI) and a “graphical user interface” (GUI). You are likely familiar with common GUI’s from Microsoft Windows and perhaps Apple’s macOS. This document will focus on a CLI known as bash, a shell for the Unix operating system by Brian Fox. The shell is an acronym for Bourne-again shell, named for the Bourne shell that it replaces. Login to the Merlin Server as discussed previously. After some introductory text, you’ll see a prompt (letting you know that the server is ready and waiting for your input) which will look something like this:

john-williams@codermerlin:~$ 

You’ll see your login name, an at (@) sign, the name of the server (“codermerlin”), a colon (:), a tilde (~), and a $. This will be followed by a flashing block called a cursor. The cursor indicates where new characters will appear as you type. The cursor will continue to flash patiently as it awaits input. We’ll get back to the meaning of the tilde soon.

We'll be using a server running Linux, a Unix-like operating system. Almost everything in Unix is either a file or a process. A file is either a destination or source for a stream of data. A process is a program that is being executed by the operating system. While printers and screens are considered to be “files” in Unix, a more general way of thinking of files is a collection of data that can be referred to by name. Files can be created by users directly (for example, via a text editor) or indirectly, such as the result of running a program like a compiler.