Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I accidentally pressed Ctrl+Alt+F12 and my display turned to black... I then had to make a reboot.. What did it do to my system? Also what does Alt+ F8 to F10 do?

share|improve this question
    
Related (but not a duplicate): Reverting from Ctrl - Alt - F1 –  Eliah Kagan Jul 26 at 23:29

3 Answers 3

Pressing Ctrl+Alt+Fn (or just Alt+Fn when not in X11, the GUI) switches to the nth virtual console (ttyn).

Often we talk about a virtual console as a usable text console. So we often say there are six virtual consoles, accessible with Alt+F1 through Alt+F6 (holding down Ctrl too if you're in the GUI when you want to switch). And we often say that then, separately, is the GUI, which can be switched (back) to with Alt+F7.

But in fact, tty7, where the GUI typically runs, is a virtual console too. It's just not usable as a text console, because it doesn't have getty running for it. getty runs for tty1 through tty6 (by default). getty sets a virtual console up to be used like a terminal and runs login to prompt for a username and password.

You can see the getty commands that are running by filtering the output of ps:

ek@Kip:~$ ps ax | grep -v grep | grep getty
 1127 tty4     Ss+    0:00 /sbin/getty -8 38400 tty4
 1150 tty5     Ss+    0:00 /sbin/getty -8 38400 tty5
 1171 tty2     Ss+    0:00 /sbin/getty -8 38400 tty2
 1172 tty3     Ss+    0:00 /sbin/getty -8 38400 tty3
 1175 tty6     Ss+    0:00 /sbin/getty -8 38400 tty6
11231 tty1     Ss+    0:00 /sbin/getty -8 38400 tty1

Since tty7 is the first virtual console that is not set up to behave like a terminal (i.e., no getty is running for it), that's the one X11 (which provides the GUI) uses.

Virtual consoles higher than tty7 exist also. It's just that, ordinarily, they neither have getty running for them, nor do they have X11 using them. The first 12 virtual consoles are accessible with the key combinations described above using function keys (because a keyboard typically has only 12 numbered function keys). They are accessible even if nothing is happening on them.

Thus, when you press Ctrl+Alt+F12, you get a blank screen because you are now on tty12, which has nothing at all running on it.

As an interesting exercise, you might try running:

sudo /sbin/getty -8 38400 tty12

Then press Alt+F12 (or Ctrl+Alt+F12 if you're in the GUI rather than one of the first 6 virtual consoles).

This will bring you to tty12, which now has a login screen and is usable as a terminal.

(If you wanted to permanently create usable text-based consoles on higher-numbered virtual consoles, then you should configure init to run getty for them automatically. When getty is run manually as above, or even if you were to add that line to a startup script, you won't get the ability to login again after logging out on the virtual console, because getty won't automatically run again. Furthermore, there are some other problems running getty in that way for production use--for example, bash job control might not be available in your login shell, after you log in. If you want to make more virtual consoles usable as text-based terminal emulators, I recommend asking a separate question about that.)

share|improve this answer

Here is a brief explanation:

The following Keys are for going to the Terminal (The black background, white letters way):

Ctrl+Alt+F1 - Will send user to tty1 or 1st Terminal

Ctrl+Alt+F2 - Will send user to tty2 or 2nd Terminal

Ctrl+Alt+F3 - Will send user to tty3 or 3rd Terminal

Ctrl+Alt+F4 - Will send user to tty4 or 4th Terminal

Ctrl+Alt+F5 - Will send user to tty5 or 5th Terminal

Ctrl+Alt+F6 - Will send user to tty6 or 6th Terminal

For GUI Terminals (Where X is typically running, or better said, where you land when Unity appears and everything looks good. The default one where you start the GUI would be F7):

Ctrl+Alt+F7 - Will send user to the 1st GUI Terminal

Ctrl+Alt+F8 - Will send user to the 2nd GUI Terminal

Ctrl+Alt+F9 - Will send user to the 3rd GUI Terminal

Ctrl+Alt+F10 - Will send user to the 4th GUI Terminal

Ctrl+Alt+F11 - Will send user to the 5th GUI Terminal

Ctrl+Alt+F12 - Will send user to the 6th GUI Terminal

The thing to note here is that you can go from one terminal to the other by pressing the corresponding keys. You should also note that, since you are running one instance of the X server (one Unity running) you will only have F7 working for the GUI Terminals. If you open another X Server session, it will start in F8 and you can switch between both by pressing the correct keys. You can keep doing this for a total (default) of 6 times which would be F7 up to F12.

share|improve this answer
    
Can there be more than 6 GUI terminals of which some are inaccessible? –  hexafraction Aug 15 '13 at 16:42
    
@hexafraction I can imagine the user typing in the terminal something like "sudo xinit -- :4 vt14" where 4 would be the session number and the 14 would be the virtual terminal. –  Luis Aug 15 '13 at 19:34
    
I know it's possible to issue a command, just not sure if it will render if switched into by software, –  hexafraction Aug 15 '13 at 19:41
    
Ok I tried and it works but the problem I think will be how to switch to it using the keyboard ;). I mean CTRL+ALT+F21?? –  Luis Aug 15 '13 at 19:55
    
No, my question is whether X.Org cuts off VTs at 12 or has keyboard-inaccessible ones past there available for software access. –  hexafraction Aug 15 '13 at 19:57

Pressing Ctrl+Alt+f12 will take you to the ubuntu system console wich sometimes replaces the terminal on some ocasions like installing a driver.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.