tr — Translate Characters

Synopsis

/usr/bin/tr [-cs] string1 string2 
/usr/bin/tr -s|-d [-c] string1 
/usr/bin/tr -ds [-c] string1 string2 
/usr/bin/xpg4/tr [-cs] string1 string2 
/usr/bin/xpg4/tr -s|-d [-c] string1 
/usr/bin/xpg4/tr -ds [-c] string1 string2
					

Description

Use the tr (translate) command to substitute one set of strings for another in a file or to remove specified characters from a file. The tr command is one of the few common UNIX commands that does not enable you to specify a file name as an argument. Instead, you must use the < redirection symbol.

The tr command can translate any number of characters. Usually, you give tr an input list of characters, specified as string1 , followed by an output list of characters, specified as ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.