tr (lower case) is a Unix command to replace or delete characters in a string of text. The most common use is:
tr "string1" "string2"
which copies the standard input to the standard output, replacing each character from "string1" with the corresponding character from "string2". For example, this tr command will encode what you type as rot13:
tr 'a-zA-Z' 'n-za-mN-ZA-M'

  TR is what the gang of punks calls itself in Suburbia (the punk-rock classic, not the Eric Bogosian/Richard Linklater version). It Stands for "The Rejected". They make one get it branded on them before they can join the gang and stay in the squat.

N.B.The command 'TR', is of course lowercase in Unix systems¹

The tr command dates back to the original Unix operating system developed by Ken Thompson and Dennis Ritchie in the 1070s. It (like awk and sed) has hung about into modern Unix-like systems largely because of its utility.

The user can perform operations like replacing specific characters, deleting characters, or converting text to uppercase or lowercase. By reading from standard input and writing to standard output, tr provides a straightforward way to manipulate text data to clean up data, adjust formatting, or perform simple text transformations.

It was part of the original Unix operating system developed at Bell Labs by Ken Thompson and Dennis Ritchie. .For Linux, the tool was created as part of the GNU coreutils package. The command's name, tr, stands for "translate" or "transform," reflecting its primary function of mapping or substituting characters in text.

The utility was designed to handle basic character transformations, such as replacing one set of characters with another or deleting characters from the input stream. As Unix evolved, tr became a standard part of the Unix toolbox and was later included in various Unix-like operating systems, including Linux. Its simplicity and effectiveness in performing text transformations have made it a staple command in Unix-based environments for decades.

An example of how it might be used: echo "the cloud is just someone else's computer" | tr '[:lower:]' '[:upper:]' gives:"THE CLOUD IS JUST SOMEONE ELSE'S COMPUTER"
.

¹ Unix-like OSes are all case-sensitive, so using the all-caps title 'TR' will throw a "command not found" error in most shells.

Qualifies for Brevity Quest 2024

xclip -o | wc -w
279

Log in or register to write something here or to contact authors.