Tty (Unix)

Command to print the file name of the terminal connected to standard input From Wikipedia, the free encyclopedia

Tty (Unix)

In computing, tty is a command in Unix and Unix-like operating systems to print the file name of the terminal connected to standard input.[1][2]

Quick Facts Initial release, Operating system ...
tty
Initial releaseNovember 3, 1971; 53 years ago (1971-11-03)
Operating systemUnix and Unix-like
PlatformCross-platform
TypeCommand
Close

tty stands for TeleTYpewriter.[3]

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.[4]

See also

References

Loading related searches...

Wikiwand - on

Seamless Wikipedia browsing. On steroids.