TTY
Platform Ops Glossary Terminal & CLI
Fundamentals, Kernel & Shell · Term #6

Terminal & CLI

The text interface for typing commands to the shell, as opposed to a graphical desktop.

Category
Fundamentals, Kernel & Shell
Complexity
Beginner
Glossary Entry
#6 of 190
ShellBashLinux CommandsShellBashLinux Commands
What Is It

The Short Answer

"Terminal" and "shell" get used interchangeably but are two different programs stacked on top of each other. The terminal (or terminal emulator — Gnome Terminal, iTerm2, Windows Terminal) is the window that displays text and captures your keystrokes. The shell is the program running inside that window, interpreting what you type.

CLI (Command-Line Interface) is the broader concept: any interaction with software through typed text commands rather than clicking. A shell is the most common CLI on Linux, but plenty of individual programs (psql, mysql, python's REPL) have their own CLI too.

How It Works

Under The Hood

The terms tty and pty are historical leftovers from real hardware: a tty (teletypewriter) was a physical terminal device wired to a mainframe. Modern terminal emulators create a pty (pseudo-terminal) — a software-emulated version of that same device interface — so old Unix conventions around line editing and signals still work unchanged.

Terminal multiplexers (tmux, screen) sit between the terminal and shell to let one terminal window host multiple independent shell sessions, and — importantly — keep those sessions running even if the terminal window itself is closed or the SSH connection drops.

In Practice

Example Commands

inspect your terminal
tty
# which pty device you're attached to, e.g. /dev/pts/3
echo $TERM
# terminal type your programs use to decide what escape codes are safe to send
Watch Out For

Common Mistakes

⚠️Closing an SSH terminal window mid-command and being surprised the process died — without nohup, screen, or tmux, a closed terminal sends SIGHUP to everything running in it.
⚠️Blaming the shell for a rendering glitch (broken colors, garbled characters) that's actually the terminal emulator misinterpreting an escape sequence.
VA
Vishal Abhinav
Platform Ops Engineer · Linux & Unix Glossary