Manual pages › General commands (1)
tty-original(1)
get the name of the terminal
From the original Amiga UNIX 2.1 manual. Some things it mentions may not be in this release.
With the coreutil package (with the extra set), see tty(1) instead.
Also by this name: tty(7), Devices and drivers
NAME
tty - get the name of the terminal
SYNOPSIS
tty [ -l ] [ -s ]
DESCRIPTION
tty prints the path name of the user's terminal.
-l prints the synchronous line number to which the user's terminal is connected, if it is on an active synchronous line.
-s inhibits printing of the terminal path name, allowing one to test just the exit code.
EXIT CODES 2 if invalid options were specified, 0 if standard input is a terminal, 1 otherwise.
DIAGNOSTICS
``not on an active synchronous line'' if the standard input is not a synchronous terminal and -l is specified. ``not a tty'' if the standard input is not a terminal and -s is not specified.