From: Teresa and Dale <teendale@vista-express.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Re: [OT] Question about duplicate lines in file
Date: Mon, 12 Jun 2006 17:52:21 -0500 [thread overview]
Message-ID: <448DF025.4010600@vista-express.com> (raw)
In-Reply-To: <20060612201526.3123e8af@hactar.digimed.co.uk>
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. This will
>>do it (as root):
>>
>>cat /etc/hosts | tr -s ' ' | sort | uniq -i > /etc/hosts.new
>>
>>
>
>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 be exact. The file was blank.
O_O LOL I'm learning though.
Dale
:-)
--
gentoo-user@gentoo.org mailing list
next prev parent reply other threads:[~2006-06-12 23:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-12 16:42 [gentoo-user] [OT] Question about duplicate lines in file Teresa and Dale
2006-06-12 16:54 ` Raymond Lewis Rebbeck
2006-06-12 17:19 ` Teresa and Dale
2006-06-12 17:32 ` Matthew Cline
2006-06-12 17:37 ` Raymond Lewis Rebbeck
2006-06-12 17:37 ` Neil Bothwick
2006-06-12 17:45 ` Mike Williams
2006-06-12 17:55 ` [gentoo-user] " Christer Ekholm
2006-06-12 18:39 ` Alan McKinnon
2006-06-12 19:15 ` Neil Bothwick
2006-06-12 22:52 ` Teresa and Dale [this message]
2006-06-12 23:23 ` Neil Bothwick
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=448DF025.4010600@vista-express.com \
--to=teendale@vista-express.com \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox