From owner-freebsd-fs@FreeBSD.ORG Tue Jul 12 11:44:27 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5C7B1106564A for ; Tue, 12 Jul 2011 11:44:27 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 32B708FC08 for ; Tue, 12 Jul 2011 11:44:27 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id DB60546B03; Tue, 12 Jul 2011 07:44:26 -0400 (EDT) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 683B58A02C; Tue, 12 Jul 2011 07:44:26 -0400 (EDT) From: John Baldwin To: freebsd-fs@freebsd.org Date: Tue, 12 Jul 2011 07:44:25 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110617; KDE/4.5.5; amd64; ; ) References: <10589627.445480.1310418556785.JavaMail.root@erie.cs.uoguelph.ca> <20110712202759.H1311@besplex.bde.org> In-Reply-To: <20110712202759.H1311@besplex.bde.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201107120744.26047.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 12 Jul 2011 07:44:26 -0400 (EDT) Cc: Subject: Re: request for review of exports.5 update X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2011 11:44:27 -0000 On Tuesday, July 12, 2011 6:50:09 am Bruce Evans wrote: > BTW, does anyone know a good way of not seeing duplicates in commands > like "zgrep -r wrt /usr/share/man"? find(1) doesn't seem to have any > flag to suppress duplicates. du(1) has to know how to not count > duplicates internally. I think it as special code for this and there > is no special support for this in fts(3). Recently I have been annoyed > by duplicates under .svn. I want to type a simple grep -r or > "find . | xargs grep" without any complicated pattern for the file names > and not see multiple copies. I actually have resorted to using specialized commands and aliases for doing diffs and greps in source trees. From my .cshrc: alias cvsdiff diff -uprN -x \'\*~\' -x \'\*.o\' -x \'\*.orig\' -x \'\*.rej\' -x compile -x CVS -x .svn -I \'\\\$FreeBSD\' alias cvsndiff diff -upr -x \'\*~\' -x \'\*.o\' -x \'\*.orig\' -x \'\*.rej\' -x compile -x CVS -x .svn -I \'\\\$FreeBSD\' (cvsndiff doesn't include new files) And a script I keep in my ~/bin: % cat kgrep #!/bin/sh # # Grep inside a kernel directory skipping compile directories and revision # control directories find `ls` ! -path '*compile*' ! -path '*.svn*' ! -path '*CVS*' \ ! -path '*cscope*' ! -type d -print0 | xargs -0 grep -H "$@" I also use cscope and xcscope.el to navigate kernel trees which is faster than grep for cases where it works. -- John Baldwin