The tr command in Linux is used for translating, deleting, or squeezing characters from standard input and writing the result to standard output. Its basic syntax is:
tr [OPTION]... SET1 [SET2]
Where:
SET1is the set of characters to be translated or deleted.SET2is the set of characters that will replace those inSET1.
Main Functionalities:
- Character Translation: Replace characters from one set with another (e.g., converting lowercase to uppercase).
- Character Deletion: Remove specific characters from the input using the
-doption. - Character Squeezing: Compress repeated characters into a single occurrence using the
-soption.
These functionalities make tr a versatile tool for text manipulation in Linux.
