emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: Search files in a folder


From: 노정태
Subject: Re: [Orgmode] Re: Search files in a folder
Date: Mon, 13 Sep 2010 16:15:41 +0900

Suvayu, I read your comment, and googled about what I can't understand.

In Emacs, M-x grep <RET> Filename * <RET> 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 <address@hidden>
2010/9/13 suvayu ali <address@hidden>
2010/9/12 노정태 <address@hidden>:
> 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 <regex> <wildcard_to_match files>
2. search for results and show results with context
   grep -nHB <number> -E <regex> <wildcard_to_match files>
   # context lines before matching lines
   grep -nHA <number> -E <regex> <wildcard_to_match 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
you want to search
   find -type f -name <shell_wildcard_to_match_files> -print0 | 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]