This character can be generated alone by the ESC key found on most
keyboards, or by typing the left bracket character while holding down
the CONTROL key (often shown as
The special escape sequences used by your terminal are stored in the terminal's, which allows programs to respond appropriately to all of the special keys on the keyboard. Programs themselves issue escape sequences to do such things as move around the screen, highlight text, and so on.
However, there are cases where it's useful to issue escape sequences manually - or in an alias or shell script that you write. For example, you canor .
Most of our examples use escape sequences for the common DEC VT100 series of terminals (which are also recognized by almost all terminal emulation programs).
How do you find out what escape sequences your terminal uses? After all, it is quite hardware-specific. If you have a terminal manual, they should be listed there. Otherwise, you can, and with the help of the manual page, or a book such as O'Reilly & Associates' termcap & terminfo , decipher the obscure language used there. Or, use a program like ; it will find those sequences for you.
To actually type an escape sequence into a file, use your editor's "quote next character command" ( 41.9 .) before pressing the ESC key. To use an escape character in an alias, try the technique shown in article
Don't be confused if you see an escape sequence that looks like this:
Some terminals use a real left bracket at the start of their escape
sequence; it will follow the escape character itself (represented as