This original article belongs to the "Linux Greenhouse" blog.
The blog address is http://roclinux.cn.
Article author for Roc
I hope you can donate to support the operation and development of the Linux greenhouse blog. See "About Donations"
==
The TR instruction reads the data from the standard input device and, after the string translation, outputs to the standard output device.
Cat filename |tr u n : Used to replace the U in the filename file with N on the screen , but the actual file is not replaced
Cat FileName | TR- d ABC deletes all occurrences of A or B or C characters from the filename content on the screen and displays
Cat filename|tr [: Lower:] [: Upper:] capitalizes all lowercase in the contents of the file
A substitution symbol similar to [: Lower:] is also:
[: Alnum:] denotes all letters and numbers
[: Alpha:] denotes all the letters
[: blank:] denotes all spaces
[:d igit:] denotes all numbers
[: Graph:] denotes all printable characters but does not include spaces
[:p rint:] denotes all printable characters, including spaces
For an overview view, refer to the use of the TR command in detail
TR Command-linux command five-minute series six