Bootstrap FreeKB - Linux Fundamentals - Switch between TTY consoles
Linux Fundamentals - Switch between TTY consoles

Updated:   |  Linux Fundamentals articles

When using the Terminal in Linux, or when in runlevel 1, the text-only interface will be a TTY or PTS console. In this example, the interface is a TTY console.

 

In the middle of the 19th century, before Unix was developed, timeshare systems had terminals that allowed you to interact with a primitive computer. The timeshare system allowed you to send output to a teletypewriter, and the teletypewriter would print the output. Similar to the timeshare systems, Unix systems also use a terminal. The Unix systems also had the capability of sending output to a teletypewriter. In Unix, a teletypewriters was abbreviated to TTY, which is how TTY became synonymous with a Unix terminal. While teletypewriters are no longer used to interact with a Unix computer, the abbreviation TTY is still used to represent the Linux Terminal.

 

Linux computers have numerous TTY virtual consoles, such as /dev/tty1, /dev/tty2, /dev/tty3, et cetera. The tty command will display which TTY virtual console is being used. In this example, /dev/tty1 is being used.

[john.doe@server1 ~]# tty
/dev/tty1

 

The following commands can be used to switch between TTY virtual consoles.

  • tty1 = Ctrl + Alt + F1
  • tty2 = Ctrl + Alt + F2
  • tty3 = Ctrl + Alt + F3
  • tty4 = Ctrl + Alt + F4
  • tty5 = Ctrl + Alt + F5
  • tty6 = Ctrl + Alt + F6

/dev/tty7 is typically used to get a graphical environment, such as GNOME, KDE, or Unity. Ctrl + Alt + F7 can be used to swtich to TTY7.

 

Pseudo Terminal Slave (/dev/pts/0)

When making a connection to a Linux computer using some other application, such as SSH or PuTTY, a pseduo terminal slave (pts) session is used. The tty command will display which pts session is being used. The Ctrl + Alt + F# combinations will not work when you have an SSH connection. Instead, you would simply make multiple SSH connections to have multiple virtual consoles.

[john.doe@server1 ~]# tty
/dev/pts/0

 

/dev/console

/dev/console can be any TTY device, such as /dev/tty1, /dev/tty2, /dev/tty3 or any PTS device such as /dev/pts/0, /dev/pts/1, or /dev/pts/2. The console is set when the system is booted. In this example, when the system is booted, /dev/console will be set to /dev/tty1 with a baud rate of 9600. The ioctl command can be used to choose what device the console should be associated with (see man tty_ioctl).

console=tty1,9600

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


January 23 2021 by rm -rf /
I found this article useful, but my main point is the hilarious human-check.For real, you should overhaul that one. Thanks for the article though

January 23 2021 by rm -rf /
For real spamming the comment section is somehow really attempting -- more than without any check, just because it would be a mini challenge

Add a Comment


Please enter eeaf0a in the box below so that we can be sure you are a human.