Getting ready

The simplest way to accomplish this is with the tac command (the reverse of cat). The task can also be done with awk.

Get Linux Shell Scripting Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.