TTY(1) — UNIX Programmer’s Manual
NAME
tty − get terminal name
SYNOPSIS
tty
DESCRIPTION
Tty prints the pathname of the user’s terminal.
EXAMPLE
tty
produces "/dev/tty7" if user is on tty7.
DIAGNOSTICS
"Not a tty" if the standard input file is not a terminal.
7th Edition — 1/20/82