tr is a small and beautiful command in the UNIX command-warrior toolkit. It is one of the important commands frequently used to craft beautiful one-liner commands.
tr can be used to perform substitution of characters, deletion of the characters, and squeezing of repeated characters from the standard input. It is often called translate, since it can translate a set of characters to another set.
tr accepts input only through
stdin (standard input). It cannot accept input through command-line arguments. It has the following invocation format:
tr [options] set1 set2
Input characters from
stdin are mapped from
set2 and the output is written to
stdout (standard output).
set2 are character classes or a ...