View Single Post

  #23 (permalink)  
Old 08-18-2008
Maxwell Lol
Guest
 
Posts: n/a
Default Re: Windows freeware unique sort technique for large text files (hosts)

Donita Luddington <doniludd@sbcglobal.net> writes:

> Do you know if sort can be told to sort all but the first line?


Usually people extract the line, and put it back.
Here is a simple way to do this.

head -1 hosts >hosts.head
sed '1d' hosts | sort <options> >hosts.rest
mv hosts hosts.backup
cat hosts.head hosts.rest >hosts
rm hosts.head hosts.rest

Reply With Quote