如何反轉文件中的行順序? - 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
相關文章
相關標籤/搜索