Re: [gentoo-user] Re: [OT] Question about duplicate lines in file

2006-06-12 Thread Neil Bothwick
On Mon, 12 Jun 2006 17:52:21 -0500, Teresa and Dale wrote: > >sort -u -k1,1 /etc/hosts >/etc/hosts.new > > > >avoids the need to use cat, uniq or tr. -k1,1 sorts on the first field > >(space delimited) and -u remove lines where the sort field is the same. > Well that removed a few, all of them to

Re: [gentoo-user] Re: [OT] Question about duplicate lines in file

2006-06-12 Thread Teresa and Dale
Neil Bothwick wrote: >On Mon, 12 Jun 2006 20:39:20 +0200, Alan McKinnon wrote: > > > >>If /etc/hosts has these lines: >>127.0.0.1 localhost >>127.0.0.1 localhost >>uniq will see these as different even though they are actually the >>same entry. So he needs something like tr to squash spaces. T

Re: [gentoo-user] Re: [OT] Question about duplicate lines in file

2006-06-12 Thread Neil Bothwick
On Mon, 12 Jun 2006 20:39:20 +0200, Alan McKinnon wrote: > If /etc/hosts has these lines: > 127.0.0.1 localhost > 127.0.0.1 localhost > uniq will see these as different even though they are actually the > same entry. So he needs something like tr to squash spaces. This will > do it (as root): >

Re: [gentoo-user] Re: [OT] Question about duplicate lines in file

2006-06-12 Thread Alan McKinnon
On Monday 12 June 2006 19:55, Christer Ekholm wrote: > Teresa and Dale <[EMAIL PROTECTED]> writes: > > Thanks, read the man page, it was short so it didn't take long. > > I tried this: > > > > uniq -u /home/dale/Desktop/hosts /home/dale/Desktop/hostsort > > > > It doesn't look like it did anything

[gentoo-user] Re: [OT] Question about duplicate lines in file

2006-06-12 Thread Christer Ekholm
Teresa and Dale <[EMAIL PROTECTED]> writes: > > > Thanks, read the man page, it was short so it didn't take long. I tried > this: > > uniq -u /home/dale/Desktop/hosts /home/dale/Desktop/hostsort > > It doesn't look like it did anything but copy the same thing over. > There are only 2 lines missi