如何反转文件中的行顺序? - How can I reverse the order of lines in a file?

问题:

I'd like to reverse the order of lines in a text file (or stdin), preserving the contents of each line. 我想颠倒文本文件(或stdin)中行的顺序,保留每行的内容。 this

So, ie, starting with: 因此,即从如下开始: spa

foo
bar
baz

I'd like to end up with 我想结束 .net

baz
bar
foo

Is there a standard UNIX commandline utility for this? 是否有标准的UNIX命令行实用程序? 命令行


解决方案:

参考一: https://stackoom.com/question/379G/如何反转文件中的行顺序
参考二: https://oldbug.net/q/379G/How-can-I-reverse-the-order-of-lines-in-a-file
相关文章
相关标签/搜索