TR(1)
β¨ TR(1) β bestie, it's the tr manual β¨
okay so picture this: you've got a manual page, right? it's called tr, it lives in the General Commands Manual section (section 1, the "commands you actually type" section π
), and it is literally here to translate or delete characters. iconic behaviour honestly.
πΈ NAME πΈ
tr β translate or delete characters π¦
π SYNOPSIS π
tr [OPTION]... SET1 [SET2]
π DESCRIPTION π
Translate or delete characters. that's the whole job description bestie, and she does it flawlessly β¨
π OPTIONS π
-c,--complementβ use the complement of SET1. like, the opposite set? yeah. the leftovers. the ones not in SET1 π«Ά-d,--deleteβ delete characters in SET1, do not translate. so long, farewell π-s,--squeeze-repeatsβ replace each sequence of a repeated character that is listed in the last specified SET, with a single occurrence of that character. yes bestie, squeezing the dupes together into one single slay π-t,--truncate-set1β first truncate SET1 to length of SET2. cut her down to size βοΈ-h,--helpβ Print help. we love a helpful queen π-V,--versionβ Print version. receipts, periodt β[sets]
π¦ EXTRA π¦
Translate, squeeze, and/or delete characters from standard input, writing to standard output. she reads from stdin, she writes to stdout, she does not play about it ππ₯
π VERSION π
v(uutils coreutils) 0.12.0 β no cap π«Ά
π EXAMPLES π
Replace all occurrences of a character in a file, and print the result:
tr < path/to/file find_character replace_character
Replace all occurrences of a character from another command's output:
echo text | tr find_character replace_character
Map each character of the first set to the corresponding character of the second set:
tr < path/to/file 'abcd' 'jkmn'
Delete all occurrences of the specified set of characters from the input:
tr < path/to/file [-d|--delete] 'input_characters'
Compress a series of identical characters to a single character:
tr < path/to/file [-s|--squeeze-repeats] 'input_characters'
Translate the contents of a file to upper-case:
tr < path/to/file "[:lower:]" "[:upper:]"
Strip out non-printable characters from a file:
tr < path/to/file [-cd|--complement --delete] "[:print:]"
ok important lil disclaimer bestie: The examples are provided by the tldr-pages project <https://tldr.sh> under the CC BY 4.0 License. Please note that, as uutils is a work in progress, some examples might fail. so if one of these lowkey flops, it's not you, it's the work-in-progress energy ππ
and that's the whole page, you ate it π mwah. this lil masterpiece was served fresh on 2026-09-25, brought to you by the General Commands Manual crew β TR(1), forever our main character πβ¨
π¦ where this page comes from
- ubuntu stonking: rust-coreutils 0.12.0-1ubuntu2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms