tty command on a Void Linux machine | |
Initial release | November 3, 1971; 53 years ago (1971-11-03) |
---|---|
Operating system | Unix and Unix-like |
Platform | Cross-platform |
Type | Command |
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.
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
References
- "tty". pubs.opengroup.org. Retrieved 2020-02-14.
- "tty". man7.org.
- "What does "TTY" stand for?". Ask Ubuntu. Retrieved 2020-02-14.
- "tty(1) - Linux man page". linux.die.net. Retrieved 2020-02-14.
External links
tty
– Shell and Utilities Reference, The Single UNIX Specification, Version 4 from The Open Grouptty(1)
– FreeBSD General Commands Manualtty(1)
– NetBSD General Commands Manualtty(1)
– OpenBSD General Commands Manualtty(1)
– Solaris 11.4 User Commands Reference Manualtty(1)
– Linux User Commands Manual
GNU Core Utilities command-line interface programs | |
---|---|
File system | |
Text utilities | |
Shell utilities |