From mboxrd@z Thu Jan 1 00:00:00 1970 From: suvayu ali Subject: Re: Re: Search files in a folder Date: Sun, 12 Sep 2010 21:22:09 -0700 Message-ID: References: <8739teiwsq.wl%ucecesf@ucl.ac.uk> <874oduqul6.fsf@archdesk.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=54437 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov0Yp-0003f3-6r for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 00:22:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ov0Yo-0007T2-4V for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 00:22:31 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:64573) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov0Yo-0007Sw-0b for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 00:22:30 -0400 Received: by wyb36 with SMTP id 36so6655819wyb.0 for ; Sun, 12 Sep 2010 21:22:29 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?UTF-8?B?64W47KCV7YOc?= Cc: org-mode mailing list 2010/9/12 =EB=85=B8=EC=A0=95=ED=83=9C : > Thank you everyone. > > I learned I could do it with grep, but I don't know how to use grep > properly. > grep is one of my favourite *nix tools. :) You can try invoking grep in many ways. these are my most used options, 1. simply search for a regex and show results. grep -nH -E 2. search for results and show results with context grep -nHB -E # context lines before matching lines grep -nHA -E # context lines after matching lines grep -nHC -E # context lines from both before and after matching lines 3. You can try `M-x find-grep' if you want more control over what file you want to search find -type f -name -print0 | xargs -0 grep -nH -E Note: find and grep regex are a little different from emacs regex because of some quoting differences. 'man grep' is your friend. GL :) --=20 Suvayu Open source is the future. It sets us free.