Getting Down with ...

by ...

Lesson n:

Operating Systems

Computers are machines that can do amazing tasks for people, but to do so they need to be controlled by programs which instruct them step-by-step on what to do. A special program called the operating system is responsible for control and administration of the computer itself. Operating systems load other computer programs, control use of memory, input and output devices, and the processing units that make the computer work, and manage the storage and retrieval of data through the file system.

User Interface

For human beings to interact directly with computers, some kind of technology must exist that allows people to express their intentions in a way that computers can understand. This technology is called a user interface.

Graphical user interface

If you learned to use a personal computer within the last twenty-five years or so, chances are you interacted with it using a graphical user interface, or GUI (pronounced gooey). The GUIs of common desktop operating systems are characterized by windows, icons, menus, and a pointer (mouse) that users manipulate to control the launching and operation of programs.

Command-line interface

While GUIs certainly make computers easier to use for the average computer user, they introduce greatly increased demands on the computer system, as well as increased security and maintainance costs. On a personal desktop system this tradeoff is worth the cost, but on a server it is frequently not. Instead, many servers use a command-line interface, or CLI instead of a GUI. Command-line interfaces use text commands that users type at a command prompt (which will be a $ on Ubuntu systems) to control and manage files and applications.

The Unix shell

A common CLI for websites is the Unix shell, which is the CLI that we will learn in this tutorial. Specifically we will be using the Bash shell. Bash is the default shell on most GNU/Linux systems and macOS. It is also now available to Windows 10 users as an add-on.

A Unix shell is a command-line interface to the Unix operating system. Many web hosting services give customers a unix shell as the way to manage their websites. This tutorial has been developed for users of the Ubuntu distribution of the GNU/Linux operating system, but it should prove useful to users of other versions of Unix as well.

Starting the Unix shell

To start a Unix shell from an Ubuntu GUI desktop environment, look for a program named Terminal (or sometimes console or xterm on other Unix systems). Launching this program will give you a desktop window that looks something like this:

Terminal screenshot

Colors may be different and you may see a menu and scrollbar, but the important elements of the terminal program are:

prompt
The $ character is called the command prompt. It tells you that the Unix command-line interpreter is ready to read and process commands.
cursor
The flashing square after the prompt is called the cursor. It indicates the position at which text you type at the keyboard will appear.

Commands

Commands are given to the Unix CLI by typing text at the command prompt. Here is an example of the list (ls) command:

$ ls -la .bash*

This command has three distinct parts:

command
Immediately following the prompt ($) is the command to run, which here is the ls (list) command. It displays a list of files and directories in the current directory.
options
Options modify the behavior of a command. They begin with either a dash (-) or two dashes (--). In this example both the a, all, and l, long options are specified, so a list which includes files that start with . , normally not listed, will be displayed in the detailed or long format.
arguments
The arguments include one or more specific targets on which the command should operate. In this case the .bash* argument means to only list files that begin with .bash .

Exercises:

  1. Find the terminal program on your computer. Record in a notebook (the old paper and pencil kind) what this program is called on your system and the steps you use on to launch it.
  2. Add definitions in your own words to your notebook for the following new terms:
    • GUI
    • Personal computer
    • Operating system
    • WIMP
    • server
    • CLI
    • command
    • command prompt
    • website
    • Unix shell
    • web hosting service
    • Ubuntu
    • GNU/Linux
    Wikipedia has good entries for each of these terms, but you should write short definitions that effectively summarize the meanings for your own use.
  3. Try each of the following command at your Bash command prompt, recording each command and what you see in your notebook:
    • $ ls
    • $ ls -a
    • $ ls -la
    • $ pwd
    We will explain these commands in the next lesson.