Shell

From Coder Merlin
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

The Client and the Server[edit]

Client-server-model

A client-server model is a means of distributing resources between the provider of a service and a consumer of that service, the client. You're likely very familiar with this concept though less familiar with the name. One common example of a service provided in this manner is email. You, a user, can open an email client (for example, an app on your iPhone or Outlook on a PC) which then connects to a remote server. The server is responsible for providing several services, including receiving mail on your behalf from other servers, transmitting email on your behalf to others, and storing your email for your later use.

ObserveObserveIcon.png
Observe, Ponder, and Journal:

Section 1

  1. Name at least two other services that you personally use which are implemented using a Client/Server Model

There are several advantages to this model:

  • Users don't need to personally possess the hardware required to fulfill a particular service, only a means of connecting and communicating with a server which provides the service
  • Users don't need to worry about installing and configuring the server hardware
  • Users are able to access their data from anywhere in the world (as long as they have internet access)
  • The state of a users data remains consistent, regardless of how and from where they access the server

Merlin is built upon this Client/Server Model, so you won't need any particular type of hardware or software, only a device capable of running a web-browser and a terminal emulator (available in Google Chrome).

First Connection[edit]

Coder Merlin is a cloud-based server where we’ll be doing most of our exercises. To access Merlin, you’ll need a secure shell client.

If you’re using a Mac or a Linux based device you’ll probably have a built-in client that you can access from the terminal.

If you’re using a Windows-based device, you can access a terminal by installing Google Chrome, and then within Google Chrome typing “Secure Shell Extension” and then installing the extension.

Either way, you’ll need a connection string to access the server. The connection string will begin with your first name and last name separated by a hyphen, for example: john-williams. The rest of the connection string will be @ssh.codermerlin.com

For John Williams, the entire connection string would be:

	john-williams@ssh.codermerlin.com

After you’re connected, you’ll be prompted to enter your password. After a successful logon, you'll land in the "shell".

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 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.