TR(1)

NAME
tr - translate characters

SYNOPSIS
tr [-c | -C] [-sd] set1 set2

DESCRIPTION
tr matches characters from stdin and performs translations to stdout.

OPTIONS

-c | -C
    Match to set1 complement.

-d  Delete characters matching set1.

-s  Squeeze repeated characters matching set1 or set2 if -d is set.

SET

Literal c

Escape sequence \c
    \\, \', \", \a, \b, \e, \f, \n, \r, \t, \v, \xH[H], \O[OO]

Range c-d

Repeat [c*n]
    Only in set2. If n = 0 or left out, set n to length of set1.

Character class [:class:]
    See wctype(3).

Equivalence class [=c=]
    Resolve to c.

TRANSLATION
If -d is not set, tr translates from set1 to set2 by index or character class.

If set2 is shorter than set1 or set1 is a character class, overflowing characters translate to the last character in set2.

EXIT STATUS

0   Input processed successfully.

1   An error occurred.

SEE ALSO
awk(1), sed(1), utf8(7)

STANDARDS
POSIX.1-2013. Except from equivalence classes.