From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?EUC-KR?B?s+vBpMXC?= Subject: Re: Re: Search files in a folder Date: Mon, 13 Sep 2010 16:15:41 +0900 Message-ID: References: <8739teiwsq.wl%ucecesf@ucl.ac.uk> <874oduqul6.fsf@archdesk.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1011467335==" Return-path: Received: from [140.186.70.92] (port=57287 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ov3GR-0002yV-Mf for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 03:15:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ov3GQ-0003U9-Gs for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 03:15:43 -0400 Received: from mail-gy0-f169.google.com ([209.85.160.169]:57278) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ov3GQ-0003U3-BM for emacs-orgmode@gnu.org; Mon, 13 Sep 2010 03:15:42 -0400 Received: by gyf3 with SMTP id 3so2605784gyf.0 for ; Mon, 13 Sep 2010 00:15:41 -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: suvayu ali , emacs-orgmode@gnu.org --===============1011467335== Content-Type: multipart/alternative; boundary=000e0cd2e724355e5504901edd29 --000e0cd2e724355e5504901edd29 Content-Type: text/plain; charset=EUC-KR Content-Transfer-Encoding: quoted-printable Suvayu, I read your comment, and googled about what I can't understand. In Emacs, M-x grep Filename * does what I want. Thank you. And now, I want to make it as one elisp command. What should I do? Can anybody write a simple script? Sincerely, Jeongtae. suvayu ali > 2010/9/13 suvayu ali > > 2010/9/12 =B3=EB=C1=A4=C5=C2 : > > 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 :) > > -- > Suvayu > > Open source is the future. It sets us free. > --000e0cd2e724355e5504901edd29 Content-Type: text/html; charset=EUC-KR Content-Transfer-Encoding: quoted-printable Suvayu, I read your comment, and googled about what I can't understand.=

In Emacs, M-x grep <RET> Filename * <RET> does what I w= ant. Thank you.

And now, I want to make it as one elisp command.

What should I do? Can anybody write a simple script?

Sincerely, = Jeongtae.


suvayu ali <fatkasuvayu+linux@gmail.com>
2010/9/13 suvayu ali <fatkasuvayu+linux@gmail.com>
2010/9/12 =B3=EB=C1=A4=C5=C2 <basil= 83@gmail.com>:
> Thank you everyone.
>
> I learned I could do it with grep, but I don't know how to use gre= p
> 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 <regex> <wildcard_to_match files>
2. search for results and show results with context
   grep -nHB <number> -E <regex> <wildcard_to_mat= ch files>
   # context lines before matching lines
   grep -nHA <number> -E <regex> <wildcard_to_mat= ch files>
   # context lines after matching lines
   grep -nHC <number> -E <regex> <shell_wildcard_= to_match files>
   # 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<= br> you want to search
   find -type f -name <shell_wildcard_to_match_files> -pri= nt0 | xargs
-0 grep -nH -E <regex>

Note: find and grep regex are a little different from emacs regex
because of some quoting differences. 'man grep' is your friend.

GL :)

--
Suvayu

Open source is the future. It sets us free.

--000e0cd2e724355e5504901edd29-- --===============1011467335== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1011467335==--