Return the user's terminal name (POSIX)
tty [-s]
QNX Neutrino
The tty utility writes to the standard output the name of the terminal that's open as standard input. If standard input isn't a terminal (e.g., it's a file such as /dev/null), the string not a tty is output instead.
The following command prints /dev/con1 if run on console 1:
tty
The following command prints not a tty because /dev/null causes isatty() to return 0:
tty </dev/null