previous contents up next

Unix for Advanced Users

5. Navigating effectively

5.11. What does the ASCII charset look like?

ASCII is the American Standard Code for Information Interchange. It defines eight-bit codes for all the letters in the English alphabet, plus punctuation, numbers, and some terminal control signals. ASCII was one of the few computing standards at the time the first UNIX system was written, so ASCII-encoded text became the method of choice for program output and for configuration files. This trend led to the distinct language-like nature of Unix, which some people call its flexilibity and transparency and others call its arcaneness and incomprehensibility.

Most of the time you view ASCII data as the letters and symbols it represents. Sometimes, though, it is useful to know the code for a given character. This is often be true of control characters, which are not seen but are used for special functions. (A common example is Control-d, which is used in the filesystem to represent the end of a file. Many Unix programs also accept Control-d as a request to exit: sh and bash take Control-d as a synonym for "logout".)

To see the entire ASCII character set, just man ascii. The page contains tables of ASCII codes in the familiar decimal notation, as well as in octal, the base-eight number system, and hexadecimal, the base-16 number system. Every once in a while an esoteric program will take a hexadecimal code for certain control characters, in order, e.g., to filter them out. Octal is used less.

previous contents up next