The tty command of terminal basically prints the file name of the terminal connected to standard input. tty is short of teletype, but popularly known as a terminal it allows you to interact with the system by passing on the data (you input) to the system, and displaying the output produced by the system.
How do I use tty in Linux?
You can use function keys Ctrl+Alt with function keys F3 to F6 and have four TTY sessions open if you choose. For example, you could be logged into tty3 and press Ctrl+Alt+F6 to go to tty6. To get back to your graphical desktop environment, press Ctrl+Alt+F2.
What is a tty session?
A TTY session is the environment you are in while interacting with your computer. To put it more graphically, when you open a TTY session, you’re running what can basically be understood as a copy of Ubuntu. Ubuntu installs 7 sessions onto your computer by default.