mirror of https://github.com/CrimsonTome/tldr.git
16 lines
426 B
Markdown
16 lines
426 B
Markdown
|
# tr
|
||
|
|
||
|
> translate characters - run replacements based on single characters
|
||
|
|
||
|
- replace all occurrences of a character in a file, and print the result
|
||
|
|
||
|
`tr {{find_character}} {{replace_character}} < {{filename}}`
|
||
|
|
||
|
Translate the contents of the file to upper-case, prints result.
|
||
|
|
||
|
`tr "[:lower:]" "[:upper:]" < {{filename}}`
|
||
|
|
||
|
Strip out non-printable characters from the file, prints result.
|
||
|
|
||
|
`tr -cd "[:print:]" < {{filename}}`
|