tr
Translate characters: run replacements based on single characters and character sets. More information: https://www.gnu.org/software/coreutils/manual/html_node/tr-invocation.html.
- Replace all occurrences of a character in a file, and print the result:
tr <
- Replace all occurrences of a character from another command's output:
echo | tr
- Map each character of the first set to the corresponding character of the second set:
tr < '' ''
- Delete all occurrences of the specified set of characters from the input:
tr < ''
- Compress a series of identical characters to a single character:
tr < ''
- Translate the contents of a file to upper-case:
tr < "[:lower:]" "[:upper:]"
- Strip out non-printable characters from a file:
tr < "[:print:]"
来源:tldr-pages contributors · 作者与贡献记录 · CC BY 4.0。离线整理了版式、链接和媒体显示。
