ASCII(1)

๐ŸŒธ NAME ๐ŸŒธ

so like, this page is ASCII(1) bestie, and it's about ascii โ€” she reports character aliases โœจ


๐ŸŽ€ SYNOPSIS ๐ŸŽ€

ascii [-8] [-d] [-x] [-o] [-h] [-v] [-a[ [-b] [-s] [char-alias]

(no cap, that synopsis line is exactly how it is, brackets and all, iykyk ๐Ÿ’…)


๐Ÿ’– OPTIONS ๐Ÿ’–

okay so first thing: called with no options at all, ascii behaves like ascii -h. periodt. now here's every flag, no skipping, I promise ๐Ÿซถ

  • -t โ€” Script-friendly mode!! Emits only the ISO/decimal/hex/octal/binary encodings of the character. No vibes, just data, so your scripts can eat it.
  • -s โ€” Parses multiple characters at once bestie โ€” it's the convenient way of parsing strings ๐ŸŒˆ
  • -a โ€” Prints in vertical aspect (4 columns by 32 rows) instead of 8x16. This one only combines with -d, -o, -x, -b and -8, and it must precede them โš ๏ธ so like, -a goes first, always.
  • -d โ€” ASCII table in decimal. If arguments follow, it interprets them as decimal values and prints only the corresponding character records ๐Ÿ’œ
  • -x โ€” ASCII table in hex. If arguments follow, it interprets them as hexadecimal values and prints only the corresponding character records.
  • -o โ€” ASCII table in octal. If arguments follow, it interprets them as octal values and prints only the corresponding character records.
  • -b โ€” ASCII table in binary. If arguments follow, it interprets them as binary values and prints only the corresponding character records.
  • -8 โ€” Shows bit patterns as eight bits, with a leading zero. With no other radix option and without -t or -s, this selects binary mode as if -b had been given. It combines with -a, -b, -t and -s. With -d, -o or -x, that radix gets used and any character report still shows eight bits ๐Ÿ‘‘
  • -h, -? โ€” Show a summary of the options plus a simple ASCII table. The comfort-food option fr fr.
  • -v โ€” Show the version of the program.

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so characters in the ASCII set can have so many aliases depending on context, and ascii is the bestie who knows all of them ๐Ÿ’… A character's possible names include:

  • Its bit pattern (binary representation).
  • Its hex, decimal and octal representations.
  • Its teletype mnemonic and caret-notation form (for control chars).
  • Its backlash-escape form in C (for some control chars).
  • Its printed form (for printables).
  • Its full ISO official name in English.
  • Its ISO/ECMA code table reference.
  • Its name as an HTML/SGML entity.
  • Slang and other names in wide use for it among hackers.

This utility accepts command-line strings and tries to interpret them as one of the above. When it finds a value, it prints all of the names of the character. The constructs in the following list can be used to specify character values. If an argument could be interpreted in two or more ways, names for all the different characters it might be are dumped. no picking favorites ๐Ÿ’–

  • character โ€” Any character not described by one of the following conventions represents the character itself.
  • ^character โ€” A caret followed by a character.
  • \[abfnrtv0] โ€” A backslash followed by certain special characters (abfnrtv).
  • mnemonic โ€” An ASCII teletype mnemonic.
  • hexadecimal โ€” A hexadecimal (hex) sequence consists of one or two case-insensitive hex digit characters (01234567890abcdef). To ensure hex interpretation use one of the prefixes h, 0x, x, or \x.
  • decimal โ€” A decimal sequence consists of one, two or three decimal digit characters (0123456789). To ensure decimal interpretation use one of the prefixes d, 0d, or \d.
  • octal โ€” An octal sequence consists of one, two or three octal digit characters (01234567). To ensure octal interpretation use one of the prefixes 0o, o, or \o.
  • bit pattern โ€” A bit pattern (binary) sequence consists of one to eight binary digit characters (01). To ensure bit interpretation use one of the prefixes 0b, b, or \b.
  • ISO/ECMA code โ€” An ISO/ECMA code sequence consists of one or two decimal digit characters, a slash, and one or two decimal digit characters.
  • name โ€” An official ASCII or (unofficial) slang name.
  • :class: โ€” A named POSIX character class.

The slang names recognized and printed out are from a rather comprehensive list that first appeared on USENET in early 1990 and has been continuously updated since ๐ŸŒŸ Mnemonics recognized and printed include the official ASCII set, some official ISO names (where those differ) and a few common-use alternatives (such as NL for LF). HTML/SGML entity names are also printed when applicable. All comparisons are case-insensitive, and dashes are mapped to spaces. Any unrecognized arguments or out of range values are silently ignored ๐Ÿ’€ Note that the -s option will not recognize "long" names, as it cannot differentiate them from other parts of the string.

For correct results, be careful to stringize or quote shell metacharacters in arguments (especially backslash) โš ๏ธ like, the shell will absolutely eat your backslash if you let it, bestie.

This utility is particularly handy for interpreting cc(1)'s ugly octal "invalid-character" messages, or when coding anything to do with serial communications ๐Ÿ“ก As a side effect it serves as a handy base-converter for random 8-bit values. main character energy honestly ๐Ÿ”ฅ


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

  • Eric S. Raymond esr@thyrsus.com; November 1990 (home page at http://www.catb.org/~esr/).
  • Ioannis E. Tambouras ioannis@debian.org added command options and minor enhancements.
  • Brian J. Ginsbach ginsbach@sgi.com fixed several bugs and expanded the man page.
  • David N. Welton davidw@efn.org added the -s option.
  • Matej Vela corrected the ISO names.
  • Dave Capella contributed the idea of listing HTML/SGML entities.

and that's the whole page bestie, you ate it ๐ŸŽ€ this was ASCII(1), dated 2026-10-23 โ€” go convert some random 8-bit values, I'm obsessed, bye ๐Ÿ’…โœจ

๐Ÿ“ฆ where this page comes from