May 2013
Beginner to intermediate
384 pages
7h 40m
English
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. It 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. In this recipe we will see how to use tr to perform basic translation between sets.
tr accepts input only through stdin (standard input) and cannot accept input through command-line arguments. It has the following invocation format:
tr [options] set1 set2
Input characters from stdin are mapped from set1 to set2 and the output ...
Read now
Unlock full access