The tr
command is used to translate or delete characters in a file. It can read from a file or from the standard input, and after the string translation, it outputs the result to the standard output.
-c, -C, --complement
: use the complement of SET1
.-d, --delete
: delete characters in SET1
without translation.-s, --squeeze-repeats
: replace each input sequence of a repeated character listed in SET1
with a single occurrence of that character.-t, --truncate-set1
: first truncate SET1
to the length of SET2
.--help
: display this help and exit.--version
: output version information and exit.... (The content of this section remains unchanged)
The content of the file.txt
file is as follows.
Convert all letters in the file to uppercase.
You can achieve the same using the [:lower]
and [:upper]
arguments.
Convert whitespace characters to tab.
Delete all o
characters.
Delete all numbers.
Extract numbers from a string.