reverse lines in a text file

 

change file from 

foo

bar

baz

to

baz

bar

foo

 

Linux:

tac file.txt

 

BSD:

tail -r file.txt

 

参考:https://stackoverflow.com/questions/742466/how-can-i-reverse-the-order-of-lines-in-a-file

 

posted @ 2024-10-29 19:36  profesor  阅读(4)  评论(0编辑  收藏  举报