From owner-freebsd-questions@FreeBSD.ORG Fri Aug 22 15:39:22 2008 Return-Path: Delivered-To: freebsd-questions@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84D82106564A for ; Fri, 22 Aug 2008 15:39:22 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (unknown [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 002E18FC13 for ; Fri, 22 Aug 2008 15:39:21 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.2/8.14.2) with ESMTP id m7MFdJP2067084; Fri, 22 Aug 2008 17:39:19 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.2/8.14.2/Submit) id m7MFdJLB067083; Fri, 22 Aug 2008 17:39:19 +0200 (CEST) (envelope-from olli) Date: Fri, 22 Aug 2008 17:39:19 +0200 (CEST) Message-Id: <200808221539.m7MFdJLB067083@lurza.secnetix.de> From: Oliver Fromme To: freebsd-questions@FreeBSD.ORG, dave.list@pixelhammer.com In-Reply-To: <48AECD11.1000705@pixelhammer.com> X-Newsgroups: list.freebsd-questions User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.3-STABLE (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Fri, 22 Aug 2008 17:39:20 +0200 (CEST) Cc: Subject: Re: Tailing logs X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-questions@FreeBSD.ORG, dave.list@pixelhammer.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Aug 2008 15:39:22 -0000 DAve <> wrote: > I would love to have a way to tail a log, like piping to grep, except I > see every line and the lines I would normally grep for are highlighted. > That would be cool. Anyone know of a bash command or tool that will do this? > > Side note, I am tailing sendmail after changes to my outbound queue > runners. I want to highlight my sm-mta-out lines but still see all lines. You could use this script: http://www.secnetix.de/olli/scripts/bold It's a filter that works like similar to grep, but it highlights the parts that match your regular expression. The script contains usage information. So you can do things like this: $ tail -f /var/log/maillog | bold -l myhost.mydomain (The -l option specifies to highlight the whole line, not just the part that matches.) Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "C++ is over-complicated nonsense. And Bjorn Shoestrap's book a danger to public health. I tried reading it once, I was in recovery for months." -- Cliff Sarginson