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
BSD tail:
tail -r myfile.txt
Reference: FreeBSD, NetBSD, OpenBSD and OS X manual pages.