Reversing the order of lines of a file in Mac

To reverse the order of the lines in a file use the following:


tac file > file2

Note that tac is the reverse of cat :)

Leave a Reply

Your email address will not be published. Required fields are marked *