What are Ttys for?

Asked

Viewed 719 times

2

I use Fedora 23 and CTRL + ALT + F1 up to the CTRL + ALT + F6 I access these terminals, I only need to use them when the graphic mode hangs and I need to restart the gnome and I have the definition that these ttys are terminals without graphic mode.

What is the use of these ttys and why are there so many? In my case, Fedora is already "booted" on tty2 and in the tty1 there is another graphical way to log in, there is some purpose in it or it is just a default to be initialized in this tty2 (never noticed this in other distros)?

1 answer

4


What is the use of these ttys and why there are so many?

The tty (The TYpe Writer) is a driver connecting a device physical (e.g.: keyboard, modem, printer) core of the operating system.

It is used, for example, so that more users can use the same CPU or for the control of tasks (or Jobs).

Through a terminal you can control other processes (e.g., change the priority, state, or "kill" a process) that are using other terminals.

The example mentioned in the question is a process control:

... when graphic mode crashes and I need to restart gnome ...

Graphic mode (usually connected to tty7) "locked" and through another terminal, you can delete or restart this process.

The number of 6 text terminals (tty1 at the tty6) has been defined and does not have a given reason.

Despite low driver memory consumption tty (ex: from 8kb to 48kb per terminal), you can change the number of physical terminals in the file inittab or ttys (it is necessary to consult the documentation as it depends on the operating system).

Before changing, it is recommended to take a system backup.

Example of a file snippet inittab to a system Debian:

# /sbin/getty invocations for the runlevels.
#
# The "id" field MUST be the same as the last
# characters of the device (after "tty").
#
# Format:
#  <id>:<runlevels>:<action>:<process>
#
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100

# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3

Historical and technical references:

The TTY demystified

POSIX terminal interface

Linux Internals - Simone Demblon & Sebastian Spitzner - Terminal Emulation

Computer terminal Explained

The Terminal and Job Control

The Evolution of the Unix Time-sharing System

Seventh Edition Unix terminal interface

Origins and History of Unix, 1969-1995

Browser other questions tagged

You are not signed in. Login or sign up in order to post.