All Alt + F-key combinations lead to different virtual terminals or virtual consoles (they're also ttys, but not all ttys are virtual terminals/consoles).
If you're in X, you need to add Ctrl to that by default. This combination also works on the console these days, presumably to keep things consistent. Additionally, you can cycle through all of your allocated virtual consoles using Alt← and Alt→ (only works on the console). If you're running X, this will eventually lead you back to your X session.
The only difference is what's running on each terminal. Generally, the first few terminals allow you to log in. If your distribution uses init
(i.e. not recent Ubuntus), you can change what terminals do that by editing /etc/inittab
, then typing sudo init q
to activate the new configuration. Search for ‘tty1
’ and you'll find the right place. Or do man 5 inittab
to get all the information.
Unused consoles
A black (or white, depending on your terminal setup and platform) screen with a cursor blinking (or not, depending on your terminal setup and platform :) ) means that particular virtual terminal isn't virtually connected to anything. You can activate it by sending it something. Just type
ls -la >/dev/tty8 # if you re root
ls -la | sudo tee /dev/tty8 # if you're not
Then, with CtrlAltF8, you should see the output of ls -la
.
Virtual consoles may also run other things than getty
(a terminal manager program that initialises a virtual/physical terminal or modem and runs login
to ask for your username and password). On some installations, one of the consoles outputs system logs. On most installations, the kernel also outputs its critical messages (or, if you're really unlucky, all of its messages) to one or more of these consoles — it could be console 1, or it could be whichever console is active.
Unallocated Consoles
The kernel saves memory by allocating a new virtual console when it's first used. If a console is unallocated, pressing its key combination does nothing, and using Alt and the arrow keys skips past it. This may make it seem like only a few of the Alt and F-key combinations are mapped to consoles, when in fact they all are.
More consoles than you know what to do with
When I first read the kernel code pertaining to this functionality, I found the kernel supported up to 63 virtual consoles. If your keyboard has more than 12 function keys, additional consoles may be mapped to the extra ones. Also, additional consoles are mapped to various key combinations. On my Debian box, 36 consoles are mapped to three sets of F-key combinations:
AltF1 – AltF12: tty1
– tty12
AltGrF1 – AltGrF12: tty13
– tty24
AltGrShiftF1 – AltGrShiftF12: tty25
– tty36
The rest can be made accessible via custom keymapping or using Alt and the arrow keys.
Graphically Challenged
Having lots of consoles used to be very useful. Many of us used to develop code on the consoles, not X (X was quite heavy on my i486/33 with its 16 megs of RAM), so several high-resolution consoles would replace the tabs on a modern, graphical terminal.