How can I reverse the order of lines in a file?

Also worth mentioning: tac (the, ahem, reverse of cat). Part of coreutils.

Flipping one file into another

tac a.txt > b.txt

Leave a Comment