From c86216e2612ba236816a5210e50aaa27ef0cad0a Mon Sep 17 00:00:00 2001 From: Daniel Senff Date: Thu, 12 Mar 2015 09:41:54 +0100 Subject: [PATCH] Create tr.md tr is a small utility for translating characters in text documents --- pages/common/tr.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pages/common/tr.md diff --git a/pages/common/tr.md b/pages/common/tr.md new file mode 100644 index 000000000..423d1ba65 --- /dev/null +++ b/pages/common/tr.md @@ -0,0 +1,15 @@ +# 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}}`