[prev] [index] [next]

tr: transliterate characters

The tr command converts text char-by-char according to a mapping.

tr 'sourceChars' 'destChars' < dataFile

Each input character from sourceChars is mapped to the corresponding character in destChars.

Example:

tr 'abc' '123' < someText

Has sourceChars='abc', destChars='123', so a 1, b 2, c 3

Note: tr doesn't accept file name on command line.