How Does Tr Work in Linux?
Contents the Tr Command Reads a Byte Stream from Standard Input (Stdin), Translates or Deletes Characters, Then Writes the Result to the Standard Output...
Contents
The tr command reads a byte stream from standard input (stdin), translates or deletes characters, then writes the result to the standard output (stdout). If we don’t pass any options to tr, it will replace each character in SET1 with each character in the same position in SET2.
How do I use tr in Linux?
10 tr Command Examples in Linux
- tr (short for translate) is a useful command line utility that translates and/or deletes characters from stdin input, and writes to stdout. …
- A simple tr command use case is to change all lower case letters in text to upper case and vice versa, as shown below.
How do you use tr?
tr stands for translate.
- Syntax. The syntax of tr command is: $ tr [OPTION] SET1 [SET2]
- Translation. …
- Convert lower case to upper case. …
- Translate braces into parenthesis. …
- Translate white-space to tabs. …
- Squeeze repetition of characters using -s. …
- Delete specified characters using -d option. …
- Complement the sets using -c option.