加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

在Bash中反转文本文件

发布时间:2020-12-15 18:27:06 所属栏目:安全 来源:网络整理
导读:如何在 Bash中反转文本文件? 例如,如果some.txt包含以下内容: bookpencilruler 那怎么能得到这个呢? : relurlicnepkoob 尝试tac和rev命令的组合形式, $tac file | revrelurlicnepkoob 来自man tac tac – concatenate and print files in reverse 来自ma
如何在 Bash中反转文本文件?

例如,如果some.txt包含以下内容:

book
pencil
ruler

那怎么能得到这个呢? :

relur
licnep
koob
尝试tac和rev命令的组合形式,
$tac file | rev
relur
licnep
koob

来自man tac

tac – concatenate and print files in reverse

来自man rev

The rev utility copies the specified files to standard output,reversing the order of characters in every line. If no files are specified,stan

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读