| tty | |
|---|---|
tty command on aVoid Linux machine | |
| Initial release | November 3, 1971; 54 years ago (1971-11-03) |
| Operating system | Unix andUnix-like |
| Platform | Cross-platform |
| Type | Command |
Incomputing,tty is a command inUnix andUnix-likeoperating systems to print the file name of the terminal connected tostandard input.[1][2]
tty stands for "teletypewriter".[3]
Thetty 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 beingpiped) "not a tty" is printed tostandard output 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]