Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] is a nice "place" :-D
Date: Tue, 17 May 2011 07:27:04
Message-Id: 20110517082537.27317958@digimed.co.uk
In Reply to: Re: [gentoo-user] is a nice "place" :-D by Alan McKinnon
1 On Tue, 17 May 2011 01:33:39 +0200, Alan McKinnon wrote:
2
3 > grep "GET /Tmp/Linux/G" | /var/log/apache2/access_log | grep-v <myip> |
4 > \ awk '{print $1}' | sort | uniq | wc
5 >
6 > In true grand Unix tradition you cannot get quicker, dirtier or more
7 > effective than that
8 >
9
10 awk does pattern matching, o you can ditch the grep stage and use
11
12 awk '! /myip/ {print $1}'
13
14 You could use awk to search for the GET patterns too, not only saving yet
15 another process, but making sure that no one else, including you next
16 month, can work out what the command is supposed to do.
17
18 sort -u would save having a separate process for uniq, but I've no idea
19 if it's faster. It's only worth using sort -u if you would use uniq with
20 no arguments.
21
22
23 --
24 Neil Bothwick
25
26 - We are but packets in the internet of Life-

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] is a nice "place" :-D Pandu Poluan <pandu@××××××.info>