$ 0 0 This will work on both BSD and GNU.awk '{arr[i++]=$0} END {while (i>0) print arr[--i] }' filename