From owner-freebsd-fs@FreeBSD.ORG Tue Jul 12 14:52:45 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 02F64106564A for ; Tue, 12 Jul 2011 14:52:45 +0000 (UTC) (envelope-from inyaoo@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id D0B828FC13 for ; Tue, 12 Jul 2011 14:52:44 +0000 (UTC) Received: by pvg11 with SMTP id 11so5020501pvg.13 for ; Tue, 12 Jul 2011 07:52:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:references:date:message-id:user-agent:mime-version :content-type; bh=imw4YtK7tBQLmUeH0dzqi7g1/qFCMC9xpYMyU2Voj/I=; b=qqqmhmu/J7E+2qgaVBb+yhkunD9ZiBoPedmUnNllZj2+rIVAFCrwWJELlO5U8Ezd36 8LBQY0bQMXVfI1eRuvBL9Y1tMvc6MH37BD8kYSm4yr1E3eHqLUqZrjAt8OFXQBqWVmE6 NuEzFOEVzKniP4+D8tCk1RC+jqt3dDihEIUxY= Received: by 10.68.9.5 with SMTP id v5mr32360pba.140.1310482363693; Tue, 12 Jul 2011 07:52:43 -0700 (PDT) Received: from localhost (tor-exit-readme-2wh1.kromyon.net [68.169.35.41]) by mx.google.com with ESMTPS id q5sm8788641pbk.26.2011.07.12.07.52.40 (version=SSLv3 cipher=OTHER); Tue, 12 Jul 2011 07:52:42 -0700 (PDT) From: Pan Tsu To: freebsd-fs@freebsd.org References: <10589627.445480.1310418556785.JavaMail.root@erie.cs.uoguelph.ca> <20110712202759.H1311@besplex.bde.org> <201107120744.26047.jhb@freebsd.org> Date: Tue, 12 Jul 2011 18:52:28 +0400 Message-ID: <861uxvimab.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain Subject: ignore duplicates (Was: 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 14:52:45 -0000 John Baldwin writes: > 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"? How about following? - install man page links using symbolic links, not hard links - force zgrep(1) to ignore symbolic links [...] > % 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 "$@" /usr/bin/grep has --exclude which is like your example *still* descends into ignored directories. textproc/gnugrep has --exclude-dir which is similar to using `-or -prune' which makes find(1) to not descend into ignored directories. As for whether it matters to descend here is an example # disable caching metadata/data before test $ zfs set primarycache=none foo/usr/src $ zfs set secondarycache=none foo/usr/src $ time find /usr/src/sys ! -path '*.svn*' >/dev/null $ time find /usr/src/sys ! -path '*.svn*' -or -prune >/dev/null On my 3yo box I don't even need ministat(1) to decide 26.78sr 0.21su 1.09ss 4% 1420k 45s+2194u 217pr+0pf+0w 28377+0io 28394+8935cs 3.68sr 0.07su 0.13ss 5% 1420k 46s+2260u 217pr+0pf+0w 3156+0io 3158+876cs