tty (Unix)

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
tty
Initial releaseNovember 3, 1971; 54 years ago (1971-11-03)
Repository
  • {{URL|example.com|optional display text}}Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
Engine
    Lua error in Module:EditAtWikidata at line 29: attempt to index field 'wikibase' (a nil value).
    Operating systemUnix and Unix-like
    PlatformCross-platform
    TypeCommand

    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]

    tty stands for "teletypewriter".[3]

    Usage

    [edit | edit source]

    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 standard 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]

    See also

    [edit | edit source]

    References

    [edit | edit source]
    1. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    2. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
    [edit | edit source]