In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, tty is a command in
Unix
Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
and
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s to print the file name of the terminal connected to
standard input
In computer programming, standard streams are preconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin), ...
.
tty stands for
TeleTYpewriter.
Usage
The
tty
command is commonly used to check if the output medium is a terminal. The command prints the file name of the terminal connected to standard input. If no file is detected (in case, it's being run as part of a script or the command is being
piped) "
not a tty
" is printed to stdout and the command exits with an exit status of 1. The command also can be run in silent mode (
tty -s
) where no output is produced, and the command exits with an appropriate exit status.
See also
*
Pseudoterminal
*
Teleprinter
A teleprinter (teletypewriter, teletype or TTY) is an electromechanical device that can be used to send and receive typed messages through various communications channels, in both point-to-point (telecommunications), point-to-point and point- ...
References
External links
*
*
*
*
*
*
{{Core Utilities commands
Unix software