Serial lines were first used for connecting terminals to computers. As time went on, however, many other devices have been connected via serial lines as well: modems, printers, digital cameras, and MP3 players, to name just a few. While serial lines are not fast communications channels, they do provide a straightforward, standardized way of sending data to or from a computer. In traditional contexts, serial lines use the RS-232 communications standard. We will consider this standard in some detail later in this chapter, after we’ve discussed some more practical aspects of administering serial lines and devices.
The special files for serial ports vary between systems, but they traditionally have names of the form /dev/ttyn, where n is a one- or two-digit number corresponding to the serial line number (System V and BSD style, respectively); numbering begins at 0 or 00. For example, /dev/tty2 and /dev/tty16 correspond to the third and seventeenth serial lines on a system, respectively (BSD-style systems always use two digits: /dev/tty02). Terminals, modems, and other serial devices are accessed via these special files.
On more recent System V-based systems, special files for direct terminal lines are stored in the directory /dev/term and have names that are their line number: /dev/term/14, for example. There are often links to the older names.
The file /dev/tty (no suffix) serves a special purpose. It is a synonym for each process’s controlling ...