linux - 在 UNIX 中以相反的顺序获取句子

标签 linux shell unix

我有一个名为 test 的文本文件,它的内容如下:

Pigeon is the world's oldest domesticated bird. 
Research suggests that domestication of pigeons was as early as ten thousand years ago.
People who keep domestic pigeons are generally called pigeon fanciers.

现在我想要这样的结果,句子顺序相反:

People who keep domestic pigeons are generally called pigeon fanciers.
Research suggests that domestication of pigeons was as early as ten thousand years ago.
Pigeon is the world's oldest domesticated bird. 

我该怎么做?

最佳答案

你可以使用tac命令:

$ tac file

关于linux - 在 UNIX 中以相反的顺序获取句子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18814749/

相关文章:

linux - 将逗号分隔的数字模式匹配为字符串

java - 在 Cygwin 上运行 Java 程序 - 找不到类路径

c - 如何从我的库中调用可执行文件中的函数?

linux - Xargs 的最佳输出格式

linux - 如何让 bash 变量在 awk 管道上工作

php - 您可以在 PHP 中使用 pg_connect 来仅使用本地 unix 域套接字吗?

linux - PKG_CONFIG_PATH 不清除

linux - #awk If else 循环在 ksh 中不起作用

linux - 将参数以 txt 文件的形式传递到 shell 脚本中

linux - SED - 删除后跟换行 (\n) 的字符串