The UNIX and Linux Forums
>
Top Forums
>
UNIX for Advanced & Expert Users
How to reverse the contents of a file?
User Name
Remember Me?
Password
Google UNIX.COM
Forums
Portal
Register
Rules & FAQ
Contribute
Members List
Arcade
Search
Today's Posts
Mark Forums Read
Thread
:
How to reverse the contents of a file?
View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
#
7
(
permalink
)
06-05-2007
ghostdog74
Registered User
Join Date: Sep 2006
Posts: 1,423
for small file
Code:
awk '{ arr[NR]=$0 } END{ for(i=NR;i>0;i--) { print arr[i] } } ' "file"
ghostdog74
View Public Profile
Find all posts by ghostdog74