从手册页......
-C Complement the set of characters in
string1, that is ``-C ab'' includes
every character except for `a' and `b'.
-c Same as -C but complement the set of
values in string1.
不确定set of characters
和set of values
之间是否存在差异,但这两个选项似乎都提供相同的输出......
$ echo abc123 | tr -Cd [:digit:] # 123
$ echo abc123 | tr -cd [:digit:] # 123
我在macOS 10.12.4上运行它