whatis tty
TTY
Also known as: teletype, virtual console, pty
A terminal device in Linux, either a text virtual console reached with Ctrl+Alt+F-keys or a pseudo-terminal used by terminal emulators and SSH.
What Is TTY in Linux?
The name comes from teletypewriters, the physical terminals early Unix ran on. Today the kernel provides virtual consoles (/dev/tty1 to /dev/tty6) that you can switch to with Ctrl+Alt+F3 and friends, which is useful when the graphical session freezes.
Terminal emulators and SSH sessions use pseudo-terminals (/dev/pts/N) instead. Running tty prints which device your current shell is attached to.
Example
tty
# /dev/pts/2 Learn more about TTY
- The /dev Directory Explained: Device Files, null, zero and random Everything in /dev is a file that is not a file. Block versus character devices, why /dev/null and /dev/zero differ, what /dev/random actually blocks on now, and why the directory is rebuilt from nothing on every boot.
- screen vs tmux: Which Terminal Multiplexer Why a multiplexer keeps your session alive when SSH drops, where screen still wins, and how to reattach to the session you left running last week.