Gentoo Archives: gentoo-user

From: Teresa and Dale <teendale@×××××××××××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] Question about duplicate lines in file
Date: Mon, 12 Jun 2006 17:35:02
Message-Id: 448DA232.4080809@vista-express.com
In Reply to: Re: [gentoo-user] [OT] Question about duplicate lines in file by Raymond Lewis Rebbeck
1 Raymond Lewis Rebbeck wrote:
2
3 >On Tuesday, 13 June 2006 2:12, Teresa and Dale wrote:
4 >
5 >
6 >>Hi folks,
7 >>
8 >>I have batched a bunch of servers in my hosts file to block, for ads and
9 >>all that crap. I got them from several different places, some I have
10 >>found too, and am sure there are dups in there, same server but pasted
11 >>from several sources. I am not a programer at all and don't even really
12 >>know what to search for. I would like to remove the duplicate entries
13 >>and then put them in alphabetical order if I could. I would gladly then
14 >>make this available if someone wanted to host it. I don't have a place
15 >>to host it.
16 >>
17 >>Oh, there is 15,000 entries in my hosts file. O_O
18 >>
19 >>Could someone tell me how this is done? May even learn something here.
20 >>If I can do this, I'm sure I will.
21 >>
22 >>Thanks.
23 >>
24 >>Dale
25 >>
26 >>:-) :-)
27 >>
28 >>
29 >
30 >'uniq' and 'sort' should do what you're after, check out the man pages.
31 >
32 >
33 >
34
35
36 Thanks, read the man page, it was short so it didn't take long. I tried
37 this:
38
39 uniq -u /home/dale/Desktop/hosts /home/dale/Desktop/hostsort
40
41 It doesn't look like it did anything but copy the same thing over.
42 There are only 2 lines missing. Does spaces count? Some put in a lot
43 of spaces between the localhost and the web address. Maybe that has a
44 affect??
45
46 Thanks for the help. I had never seen that command before. I had heard
47 of sort, never used it though. I do have those on my desktop. I'm
48 playing with copies instead of my real hosts file.
49
50 Thanks again.
51
52 Dale
53 :-) :-)
54 --
55 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] [OT] Question about duplicate lines in file Matthew Cline <matthew.cline@×××××.com>
Re: [gentoo-user] [OT] Question about duplicate lines in file Neil Bothwick <neil@××××××××××.uk>
Re: [gentoo-user] [OT] Question about duplicate lines in file Raymond Lewis Rebbeck <dystopianray@×××××.com>
Re: [gentoo-user] [OT] Question about duplicate lines in file Mike Williams <mike@××××××××.uk>
[gentoo-user] Re: [OT] Question about duplicate lines in file Christer Ekholm <che@××××××.se>