3

Shell之rev与tac

 2 years ago
source link: https://mryqu.github.io/post/shell%E4%B9%8Brev%E4%B8%8Etac/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Shell之rev与tac

时间:

2020-12-29

  |   分类: Tool   Linux  

  |  

阅读: 19 字 ~1分钟

今天想把一个文件内容反序输出,就找到了rev与tac这两个命令。

  • rev是对每一行内容进行反序,行序不变
  • tac是对行序反序, 每一行内容不变
mryqulax> cat test.log
whoami
123
mryqulax> rev test.log
imaohw
321
mryqulax> tac test.log
123
whoami

标题:Shell之rev与tac
作者:mryqu
声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 3.0 CN 许可协议。转载请注明出处!


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK