Your Linux workstation display may look like just one terminal. It's actually seven terminals — or even more — in one. Linux has built-in virtual consoles, a series of ttys (Section 2.7) that you can log into separately: each one can have a login session, with its own shell, working at the same time as the others. You can see only one of these consoles at once; you bring a console into view by pressing a hot-key combination. For instance, I log into the first virtual console as root and the second as myself.
If your Linux system comes up after a reboot with a mostly blank screen something like this:
Red Hat Linux release 6.2 (Zoot) Kernel 2.2.14-5.0 on an i686 penguin login:
you're seeing one of the virtual consoles — in this case, it's the first one you've seen since the reboot, so it has to be console number 1. On the other hand, if your system boots to an X Window display with a graphical xdm or gdm login box, you're using a different virtual console, probably console number 7. All of this is configurable. But by default, consoles 1 through 6 are ttys, with getty ( Section 24.2) processes running, ready to manage individual login sessions. Virtual console 7 is an X Window System display.
When you log out of one of the tty
-type consoles (by typing exit or logout), the getty process
there prints a new login
: prompt. But not
every one of these ttys needs a login session. For
instance, while the Red Hat Linux installation program is working, it uses
the first four virtual consoles as logs that show different information
about the installation process — and the fifth has a shell prompt where you
can do work during the installation. Another handy example is this tip from
Chris Hilts, posted to http://www.oreilly.com as a followup
to a Linux feature in the summer of 2000. Add the following line to your
/etc/syslog.conf file:
*.* /dev/tty9
After the next reboot or restart of syslog, all of your system's syslog messages will appear on virtual console number 9 — where you can see them at any time by pressing CTRL-ALT-9.
The tty-type virtual consoles have some other nice features. One is a scrolling buffer that lets you scroll back to see previous screens of text. Press SHIFT-PAGE UP to move to previous screenfuls, and SHIFT-PAGE DOWN to move toward the most recent screen.
The tty-type consoles also support copy-and-paste with your mouse. To copy an area, point to the first character and hold down the first mouse button; move to the end of the text block and release the button. The selected text should be shown in reverse video. To paste the copied text, click the third mouse button. You also can paste from one console into another with the same steps. You can't paste from a tty-type console into the X Windows, or vice-versa, though. To do that, use a temporary file. For example, highlight (copy) an area of text, then use the command:
% cat > /tmp/paste-me
...paste the text...
CTRL-d
Then switch to the other console. Either read the file directly into an application, or output the file onto the screen (cat /tmp/paste-me) and copy from that redisplayed text.
— JP