How to reverse lines of a text file?

后端 未结 9 1162
迷失自我
迷失自我 2021-01-01 10:05

I\'m writing a small shell script that needs to reverse the lines of a text file. Is there a standard filter command to do this sort of thing?

My specific applicatio

9条回答
  •  再見小時候
    2021-01-01 10:39

    There is a standard command for your purpose:

    tail -r file.txt
    

    prints the lines of file.txt in reverse order!

提交回复
热议问题