Apologies for the hiatus due to personal reasons.

1. What is rev
http://man.he.net/man1/rev
rev – reverses each line character by character,
Its function is toreverse the content of each line character by character, while keeping the order of the lines unchanged. In other words, it does not reverse the order of the lines in the file (like <span>tac</span> does), but reverses the character order of each line.
The rev tool copies the specified file to standard output while reversing the character order in each line. If no file is specified, it reads from standard input.
2. Parameter Information
[root@master1 ~]# /usr/bin/rev -hUsage: rev [OPTIONS] [FILE ...]
Options: -V, --version Output version information and exit
-h, --help Display this help and exit
For more information, see rev(1).
3. Examples
1. Assuming there is the following text, executing the reverse shows that rev only reverses characters and does not handle word boundaries
[root@master1 test]# cat ex.txt
helloworld12345
[root@master1 test]# rev ex.txt
ollehdlrow54321
# Also supports reading data from standard input
[root@master1 test]# echo "abc" | rev
cba
4. Supplement
Comparison with Similar Commands
| Command | Function |
|---|---|
<span>rev</span> |
Reversesthe character order of each line, keeping the line order unchanged |
<span>tac</span> |
Reversesthe order of lines in the file, keeping each line’s content unchanged |
<span>awk '{ for(i=NF;i>0;i--) printf("%s ",$i); print "" }'</span> |
Reverses by word (space-separated) |
The rev command is part of the util-linux package, which can be obtained from the Linux kernel archive site https://www.kernel.org/pub/linux/utils/util-linux/
5. Conclusion
rev is a simple command that is not suitable for processing large files. Sometimes one might wish that if a bad life could also be reversed by rev, how wonderful it would be.
Last but not least, feel free to communicate:
Follow the public account to leave a message, or leave a message directly below: