The TERM environment variable tells programs what type of terminal you use.

Some programs need to know what sort of terminal you have.

Character-based terminals and terminal emulators are all different. Each uses different sequences of characters (called escape sequences) for different purposes. For example, when you press the F1 key on a Digital vt100 terminal, it generates a different set of characters than if you press F1 on a Wyse-75 terminal. Each terminal also recognizes special commands to tell it where to place characters, where to place the cursor, whether to clear the screen, etc. — and each terminal uses different commands.

Simple programs, like ls or who, don’t do anything fancy, so they don’t need to know about differences between terminals. But programs that have to do anything more complicated need to first know what sort ...

Get WYNTK: UNIX System Admininistrator now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.