The original meaning of console as it related to computers was (1) an instrument panel containing the controls for a computer. The term evolved along with advances in computer technology to also mean (2) the combination of the display monitor and a keyboard connected to a computer and (3) equipment, including a display monitor and a keyboard, connected to a minicomputer, mainframe or supercomputer that is used to monitor the status of the system. Another term for console as used in this sense is terminal.
Back in the days when computers were huge boxes with dozens of terminals (which were originally teletypewriters1) linked to them, one of the terminals had the special role of system console. It was the only terminal that could be used to receive system error messages and for system recovery. Today those terminals, including the functions of the system console, are incorporated in the form of virtual consoles into the keyboard, video hardware and software used in most computers running Unix-like operating systems.
The term console now additionally means (4) a display mode that contains only text and no images and that occupies the entire screen of the display device (usually a CRT or LCD). This is possibly the main meaning of the term (and certainly the most useful) as it is applied to Linux, and thus it is the focus of this article. Sometimes the term display console is used as a synonym for this meaning of console.
A display mode that shows only text is described as a command line interface (CLI). A CLI, which is provided by a type of program called a shell, shows commands as they are typed in at the keyboard as well as the results of most such commands. A console (fourth meaning) is a CLI that occupies the entire screen of the display device and which does not sit on top of a graphical user interface (GUI).
A GUI is a type of display mode that uses images (including icons and menus), multiple windows and a mouse. GUIs have largely replaced consoles in recent years because they are often much easier to use, particularly for beginning and intermediate users. However, they have failed to completely replace CLIs, the reason being that the latter offer greater power (i.e., flexibilty) and convenience, especially for more experienced users. In Unix-like operating systems GUIs are managed by the X Window System, a program that is independent of the operating system and hardware and which runs on top of a console. When X (as it is frequently abbreviated) is in use, the messaging function of the underlying console is disabled.
A console is one of the two types of CLIs for computers. The other is a terminal window, also referred to sometimes as just a terminal (although the word terminal can also have another meaning in a computer context, as mentioned above). A terminal window is a text-only window that can be opened on a GUI (by clicking the appropriate icon or menu item). A window is a rectangular area on a GUI that contains graphics and/or text and which can be moved, resized or otherwise manipulated independently of other images, text or windows on the screen.
The functions and capabilities of a terminal window are basically the same as those of a console, although the former has the disadvantage that it can only operate when the GUI is available and operating. However, it has the advantage that the GUI desktop and any other windows open on it (including other terminal windows) can remain open at the same time that the terminal window is open. Another advantage is a much greater flexibility (and thus convenience), including the ability for the user to easily change its size and location on the screen by dragging and adjust its font size, colors and other characteristics through the use of pull-down menus.
The first personal computers had only consoles and no GUIs. An example of a console that is familiar to many early users of PCs is the MS-DOS interface prior to the development of the Microsoft Windows family of operating systems. The consoles on Unix-like systems resemble the MS-DOS console to the untrained eye, but they are actually far more sophisticated in terms of function, ease of use and power. Windows 95 and 98 featured the addition of an MS-DOS terminal window on top of the Windows GUI, although the traditional MS-DOS console could still be conjured up. (Windows NT, 2000 and XP are not based on MS-DOS, and thus they do not have an underlying MS-DOS console; however, they do have an MS-DOS emulation program, which operates in a terminal window.)
A feature of Linux is the use of virtual consoles, which are independent logical consoles that run in separate login sessions, but which are accessed from the same physical console (i.e., same keyboard and screen). That is, each virtual console can have a different, or the same, user logged into it.
On a Red Hat Linux system, seven virtual consoles are configured and active by default. Most users employ only the seventh, on which X runs, and they do not see the underlying full-text screen itself except while the computer is booting (i.e., starting up).
The existence of the first six of these virtual consoles can clearly be seen by using the ps command (which shows the processes currently on the system) together with its -a -u and -x options, that is by entering the following in a console or terminal window:
This command takes the output of ps -aux and pipes (i.e., sends) it into grep, which searches it for lines containing the string (i.e., sequence of characters) tty and then displays them on the screen.
A computer can be set up to boot into the user's choice of the X or a console by adjusting its default runlevel. Moreover, after booting, the user can switch to any of the other virtual consoles at any time, including to and from the X-containing seventh virtual console, by using simple keyboard commands. When switching to a different virtual console, the entries that have been made to any consoles previously used during the current session remain unchanged.
To switch to a different virtual console, all that is necessary is to simultaneously press CTRL, ALT and the corresponding function key. For example, to switch to the second virtual console (denoted in the Linux filesystems by tty2), all that is necessary is to simultaneously press the CTRL, ALT and F2 keys. To return to the seventh (which automatically restarts X), all that is necessary is to simultaneously press the the CTRL, ALT and F7 keys.
It is also possible to cycle through the virtual consoles and to return to X using ALT together with the left and right arrow keys.
The virtual consoles have a scrolling capability that is operated by simultaneously pressing the SHIFT and PAGE UP keys to view previous pages and the SHIFT and PAGE DOWN keys to return to later pages. The number of pages that can be scrolled back through depends on the amount of system memory. This technique does not work with text in applications that run in the console, such as text editors. (In such case, scrolling can usually be accomplished with a separate scrolling mechanism that is built into the application.)
The Importance of the Console
The console might at first appear to be an anachronism. This is because a terminal window can seemingly accomplish everything that a console can, and with much greater convenience. It is also because GUIs have become increasingly sophisticated and can do much of what both consoles and terminal windows (i.e., CLIs) can do, and often with much greater ease. In fact, the average Linux user now rarely needs to use a terminal window and almost never needs to use a console.
However, the console still is extremely useful. And it is important for the aspiring system administrator or power user to not only become familiar with it, but also to become comfortable and even proficient with it.
The reason is that there are situations in which the console is all that the system administrator or developer has to work with. For example, on some minimal systems, such as special purpose servers, routers and embedded devices, there are no GUIs. Moreover, the console is often the control mechanism of last resort on a misbehaving system that normally offers X but for which X is not currently available because of damage to the system or because repairs are being made.
Indeed, the availability of a highly sophisticated console, which can provide extensive control and repair capabilities and can operate with extremely limited resources and/or on a damaged and otherwise inaccessible system, is one of the great strengths of Unix-like operating systems.
Created April 25, 2004. Updated August 15, 2005.