Wondering how to change TTY in Linux and get out of TTY mode in Ubuntu. Read this tutorial to find out how to Switch from TTY to GUI in Ubuntu
The tty are teleprinters or teletypewriters (abbreviated as TTY). In earlier times, the teletype was a name for the printing terminals that were plugged into the mainframe computers. These devices/terminals/teletypes were used as a medium to enter and display data from a computer device and since these terminals were big. The TTY were recognised using the exact number corresponding to each teletype. So it was referred to by its device file, such as /dev/ttyN where N represented the exact terminal number.
There are three types of TTY, but mostly we work upon Virtual terminals. These terminals are used for creating normal console connections which are accessible by pressing “Ctrl+Alt+Fn” (for n between 1 and 6).
Switch Between TTYs In Linux
By default, there are 7 ttys in Linux. They are known as tty1, tty2….. tty7. The 1 to 6 ttys are command line only and the 7th tty is GUI which is for the X desktop session.
If you want to see the current tty, you can run the following command:
$ tty
You can switch between different TTYs by using CTRL+ALT+Fn keys. For example to switch to tty1, we type CTRL+ALT+F1 and for tty2, use CTRL+ALT+F2.
In simple words, press the “F” key corresponding to the TTY you want to switch to. For example, press “F1” to switch to TTY 1, “F2” to switch to TTY 2, “F3” to switch to TTY 3 and so on.
If you want to return to the graphical desktop environment (GUI) you can do so by pressing Ctrl+Alt+F7. Note that if your system has no X session, just type Alt+Fn key. You don’t need to use CTRL.
You can also use chvt (Change Virtual Terminal) command to switch between tty. The chvt command is used without function key.