Tty

The tty command prints the name of it's source of its standard input provided that is a terminal, or else outputs "not a tty".

Provided by
Most (all?) Linux distributions incorporate this from the GNU Coreutils: and use its man page

Related Commands
All of these relate to the context of the current session.
 * pwd - show the current working directory.
 * stty - show or alter terminal settings
 * printenv - show environment variables