Tty (Unix)
   HOME

TheInfoList



OR:

In
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
, tty is a command in
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser 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, an ...
and
Unix-like A Unix-like (sometimes referred to as UN*X 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 Unix-li ...
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also i ...
s to print the file name of the terminal connected to
standard input In computer programming, standard streams are interconnected 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 and point-to-multipoint configurations. Init ...


References


External links

* * * * * * {{Core Utilities commands Unix software