TTY(1) General Commands Manual TTY(1)

ttyreturn pathname of current terminal

tty

tty prints the name of the terminal used for standard input, or if not a terminal prints "not a tty0 and exits 1.

0
Standard input is a terminal.
1
Standard input is not a terminal.
>1
An error occurred.

ttyname(3)

tty should be compliant with the IEEE Std 1003.1-2024 (“POSIX.1”) specification.

Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>

2024-03-16 Linux 6.6.67-gentoo-x86_64