1TR(1) User Commands TR(1)
2
3
4
6 tr - translate or delete characters
7
9 tr [OPTION]... SET1 [SET2]
10
12 Translate, squeeze, and/or delete characters from standard input, writ‐
13 ing to standard output.
14
15 -c, -C, --complement
16 use the complement of SET1
17
18 -d, --delete
19 delete characters in SET1, do not translate
20
21 -s, --squeeze-repeats
22 replace each input sequence of a repeated character that is
23 listed in SET1 with a single occurrence of that character
24
25 -t, --truncate-set1
26 first truncate SET1 to length of SET2
27
28 --help display this help and exit
29
30 --version
31 output version information and exit
32
33 SETs are specified as strings of characters. Most represent them‐
34 selves. Interpreted sequences are:
35
36 \NNN character with octal value NNN (1 to 3 octal digits)
37
38 \\ backslash
39
40 \a audible BEL
41
42 \b backspace
43
44 \f form feed
45
46 \n new line
47
48 \r return
49
50 \t horizontal tab
51
52 \v vertical tab
53
54 CHAR1-CHAR2
55 all characters from CHAR1 to CHAR2 in ascending order
56
57 [CHAR*]
58 in SET2, copies of CHAR until length of SET1
59
60 [CHAR*REPEAT]
61 REPEAT copies of CHAR, REPEAT octal if starting with 0
62
63 [:alnum:]
64 all letters and digits
65
66 [:alpha:]
67 all letters
68
69 [:blank:]
70 all horizontal whitespace
71
72 [:cntrl:]
73 all control characters
74
75 [:digit:]
76 all digits
77
78 [:graph:]
79 all printable characters, not including space
80
81 [:lower:]
82 all lower case letters
83
84 [:print:]
85 all printable characters, including space
86
87 [:punct:]
88 all punctuation characters
89
90 [:space:]
91 all horizontal or vertical whitespace
92
93 [:upper:]
94 all upper case letters
95
96 [:xdigit:]
97 all hexadecimal digits
98
99 [=CHAR=]
100 all characters which are equivalent to CHAR
101
102 Translation occurs if -d is not given and both SET1 and SET2 appear.
103 -t may be used only when translating. SET2 is extended to length of
104 SET1 by repeating its last character as necessary. Excess characters
105 of SET2 are ignored. Only [:lower:] and [:upper:] are guaranteed to
106 expand in ascending order; used in SET2 while translating, they may
107 only be used in pairs to specify case conversion. -s uses SET1 if not
108 translating nor deleting; else squeezing uses SET2 and occurs after
109 translation or deletion.
110
112 Written by Jim Meyering.
113
115 Report tr bugs to bug-coreutils@gnu.org
116 GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
117 General help using GNU software: <http://www.gnu.org/gethelp/>
118 Report tr translation bugs to <http://translationproject.org/team/>
119
121 Copyright © 2010 Free Software Foundation, Inc. License GPLv3+: GNU
122 GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
123 This is free software: you are free to change and redistribute it.
124 There is NO WARRANTY, to the extent permitted by law.
125
127 The full documentation for tr is maintained as a Texinfo manual. If
128 the info and tr programs are properly installed at your site, the com‐
129 mand
130
131 info coreutils 'tr invocation'
132
133 should give you access to the complete manual.
134
135
136
137GNU coreutils 8.5 November 2010 TR(1)