---
name: "ttys"
section: "5"
platform: "openbsd"
package: "man"
version: "8.0-current-20261101"
release: "OpenBSD 8.0-current (2026-11-01)"
platforms: ["freebsd", "openbsd", "macos"]
url: "https://new.carta.tech/ttys"
---

# ttys(5)

terminal initialization information

## NAME

**ttys** – terminal initialization information

## DESCRIPTION

The **ttys** file contains information used primarily by [init(8)](/init/8.md) to initialize and control terminal special files. It is also used by other programs, such as [login(1)](/login/1.md) and [ttyflags(8)](/ttyflags/8.md), through the [getttyent(3)](/getttyent/3.md) library routines.

There is one line in the **ttys** file per special device file. Fields are separated by tabs and/or spaces. Fields comprised of more than one word should be enclosed in double quotes (‘"’). Blank lines and comments may appear anywhere in the file; comments are delimited by hash marks (‘#’) and newlines. Any unspecified fields will default to null.

Each line in **ttys** is of the format:

```
tty command type flags
```

The first field is the name of the terminal special file as found in */dev*.

The second field is the command to execute for the line, usually [getty(8)](/getty/8.md), which initializes and opens the line, setting the speed, waiting for a user name and executing the [login(1)](/login/1.md) utility. It can, however, be any desired command, for example the start up for a window system terminal emulator or some other daemon process, and can contain multiple words if quoted.

The third field is the type of terminal usually connected to that tty line, normally the one found in the [terminfo(5)](/terminfo/5.md) database file. The environment variable TERM is initialized with the value by either [getty(8)](/getty/8.md) or [login(1)](/login/1.md).

The remaining fields set flags in the *ty\_status* entry; see [getttyent(3)](/getttyent/3.md). The following is a list of permitted flags for each tty:

- *on*

  Have [init(8)](/init/8.md) execute the command in the second field.

- *off*

  Do not have [init(8)](/init/8.md) execute the command in the second field.

- *secure*

  Allows users with a user ID of 0 to log in on this line. If set for the *console* entry, then [init(8)](/init/8.md) will start a single-user shell without asking for the superuser password.

Additionally, the following flags modify the default behavior of the terminal line. Some of these flags may not be supported by a terminal line driver. The flag fields should not be quoted.

- *local*

  Treat the line as if it is locally connected.

- *rtscts*

  Use RTS/CTS hardware flow control, if possible.

- *mdmbuf*

  Use DTR/DCD flow control if possible.

- *softcar*

  Ignore hardware carrier on the line.

Changes to the **ttys** file take effect after it has been reloaded by [init(8)](/init/8.md), which can be triggered by sending it a HUP signal. Reloading the **ttys** file does *not* change the state of the device-specific terminal flags described above. The [ttyflags(8)](/ttyflags/8.md) utility can be used to set those flags.

## FILES

- */etc/ttys*

  ## EXAMPLES

```
# console
console	"/usr/libexec/getty std.9600"	vt220	off secure
# wscons virtual terminals
ttyC0	"/usr/libexec/getty std.9600"	vt220	on secure
# serial terminal
tty00	"/usr/libexec/getty std.9600"	unknown	off
```

## SEE ALSO

[login(1)](/login/1.md), [getttyent(3)](/getttyent/3.md), [ttyslot(3)](/ttyslot/3.md), [gettytab(5)](/gettytab/5.md), [termcap(5)](/termcap/5.md), [terminfo(5)](/terminfo/5.md), [getty(8)](/getty/8.md), [init(8)](/init/8.md), [ttyflags(8)](/ttyflags/8.md)

## HISTORY

A **ttys** file appeared in Version 5 AT&T UNIX.
