Main index

Introducing UNIX and Linux


The Computing Environment

Overview
What is a Computer?
Hardware
      Processors
      Input Devices
      Output Devices
Software
      Input and Characters
            Control Characters
      Application Programs
            Programming Languages
      The Operating System
      System Administration
History of UNIX and Linux
Conventions
Summary

Input and Characters

When communicating with UNIX, users send to the system a stream of characters. Each time a key on the keyboard is pressed, a character is sent to the machine. Usually, the computer echoes the character so that it is displayed on the screen. Similarly, to communicate with the user, the system sends a stream of characters to the user's computer, which is able to interpret the particular character coding and display the characters on the screen accordingly.

While interacting with the system, a user types in lines of text from the keyboard, terminating each line by pressing the Return (or Enter) key. These lines are interpreted as instructions to UNIX, which then responds accordingly, and displays messages on the screen. On a graphics terminal, this dialogue is between the keyboard and a specific window (typically the window over which the cursor has been placed). Manipulation of other devices such as a mouse also results in the transmission of characters to the UNIX machine. However, these are interpreted as relating to the management and display of the windows only.

Commands sent to UNIX are executed by a program called the shell. We shall see later that the shell is just one example of a program that can run on a UNIX system, but is special since it is the principal interface between a user and the very heart of the system software, known as the kernel.

Most characters that we shall use are the printing characters. These, which include letters, digits, punctuation marks and the other symbols marked on the keyboard, are displayed in the obvious way. However, other characters, known as control characters, are sometimes required by a UNIX system. Each is stored as a number using a character encoding such as ASCII For instance, the character whose code is 7 and is sometimes referred to as 'bell', if printed on your terminal, normally causes the terminal to make a noise (typically a 'beep').

Each control character has a name, typically an acronym of its description. For character number 7, this is BEL, short for 'bell'. The bell character was originally used on 'teletype' terminals to attract the attention of the user in the days of the telegraph.

Control characters can be typed by pressing a key while holding down the Ctrl key. For BEL, this key is G, and for this reason BEL is often written as ctrl-G or ^G. Some of the other control characters have anachronistic names that also relate to the functioning of a teletype, but most of them will not concern us here.

Control characters have purposes which, for the most part, are obscure. Many are used by operating systems (not necessarily UNIX) to structure data, and have meanings with historical relevance only. Some of the more useful control characters include the following. The character TAB has the effect, when sent to the screen, of moving the cursor to the next tab position (usually columns 8, 16, 24, 32, etc.). The tab key, when pressed, transmits a TAB character to the computer. The character NL (Newline) causes the cursor to move down to the left-hand side of the next row on the screen. This character is provided as input to the machine whenever the key marked RETURN (or ENTER) is pressed. The escape character, which would not normally be displayed on a screen at all, is sometimes required when typing in data. There should be a key on your keyboard marked ESC or ESCAPE.


Copyright © 2002 Mike Joy, Stephen Jarvis and Michael Luck