How to reverse lines of a text file?

后端 未结 9 1156
迷失自我
迷失自我 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:48

    Similar to the sed example above, using perl - maybe more memorable (depending on how your brain is wired):

    perl -e 'print reverse <>'
    

提交回复
热议问题