How to print lines in a reverse order using awk

Linux is the best! you will get all the tools to do the work efficiently! and for FREE!

Outputs lines from a file in reverse order using awk :

awk '{line[NR]= $0} END { for (i=NR; i >0;i--) print line[i] }' filename

Leave a Reply


imed.ws - Imed Bouchrika Website© 2003-2007.