tr
Replaces specified characters
tr [options] string1 [string2]
The tr utility reads standard input and, for each input character, maps it to an alternate character, deletes the character, or leaves the character alone. The utility writes the result to standard output.
Arguments
The tr utility is typically used with two arguments, string1 and string2. The position of each character in the two strings is important; tr replaces each character from string1 with the corresponding character in string2.
With one argument, string1, and the --delete option, tr deletes the characters specified in string1. The option --squeeze-repeats replaces multiple sequential occurrences of characters in string1 with single occurrences (for example, abbc becomes ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access