1 |
On Mon, 12 Jun 2006 17:52:21 -0500, Teresa and Dale wrote: |
2 |
|
3 |
> >sort -u -k1,1 /etc/hosts >/etc/hosts.new |
4 |
> > |
5 |
> >avoids the need to use cat, uniq or tr. -k1,1 sorts on the first field |
6 |
> >(space delimited) and -u remove lines where the sort field is the same. |
7 |
|
8 |
> Well that removed a few, all of them to be exact. The file was blank. |
9 |
> O_O LOL I'm learning though. |
10 |
|
11 |
What's the format of the file? If it's a standard /etc/hosts layout, this |
12 |
will removed duplicates based on IP address, but if you have another |
13 |
field first, you need to change the key. |
14 |
|
15 |
|
16 |
-- |
17 |
Neil Bothwick |
18 |
|
19 |
"Bother," said Pooh, as he connected at 300 bps. |