tr

tr

The tr command will translate the characters from one string to another string of text. The two strings must correspond to one another.

Options

-d delete characters from string as it goes to output

-s squeeze out repeated characters in string

In this example the contents of the file info are first viewed with cat and then the letters are all changed to caps,


cat info


mike Helena 56 Montana Street

tom Missoula 43 South Street

mary Butte 84 Copper Street


cat info | tr a-z A-Z


MIKE HELENA 56 MONTANA STREET

TOM MISSOULA 43 SOUTH STREET

MARY BUTTE 84 COPPER STREET