Categories
Command Line Quick Tips Quick Tips

How to output the contents of a file in reverse

< 1 min read

Today I learnt: If you need to output the contents of a file in reverse order i.e. last line first, there’s a counterpart to the cat command line program:

tac

See what they did there?! Not something you’ll need every day, but handy when you do.

Screenshot of using cat and tac commands in a terminal