tty (Unix)

{{Short description|Command to print the file name of the terminal connected to standard input}}

{{Other uses|TTY (disambiguation)}}

{{lowercase|title=tty}}

{{Infobox software

| name = tty

| logo =

| screenshot = File:Tty Void Linux.png

| screenshot size =

| caption = tty command on a Void Linux machine

| developer =

| released = {{Start date and age|1971|11|3}}

| latest release version =

| latest release date =

| operating system = Unix and Unix-like

| platform = Cross-platform

| genre = Command

| license =

| website =

}}

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.{{Cite web|url=https://pubs.opengroup.org/onlinepubs/9699919799/utilities/tty.html|title=tty|website=pubs.opengroup.org|access-date=2020-02-14}}{{Cite web|url=https://man7.org/linux/man-pages/man1/tty.1.html|title=tty|website=man7.org|access-date=}}

tty stands for TeleTYpewriter.{{Cite web|url=https://askubuntu.com/questions/481906/what-does-tty-stand-for|title=What does "TTY" stand for?|website=Ask Ubuntu|access-date=2020-02-14}}

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.{{Cite web|url=https://linux.die.net/man/1/tty|title=tty(1) - Linux man page|website=linux.die.net|access-date=2020-02-14}}

See also

References

{{Reflist}}