bug-coreutils
[Top][All Lists]
Advanced

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

Filename pattern in grep --include=....


From: Com MN PG P E B Consultant 3
Subject: Filename pattern in grep --include=....
Date: Tue, 31 Jan 2006 14:39:58 +0100

>From the grep man-page:

       --include=PATTERN
              Recurse in directories only searching file matching
PATTERN.

What type of PATTERN can be used here (i.e. glob, regex, extended regex,
etc.)?

For example, I want to search recursively below a directory D, but want
to check
only files starting with "no" or "uh". How do I do this using --include
?

I tried the following:

  # glob pattern
  grep -r --include="{no,uh}*" abc D

and the following:

  # extended regexp
  grep -r --include="(no|uh).*" abc D

but neither variant located my files. But I know that there are files
matching, because

  # Look at all files
  grep -r abc D

shows some matching files starting with 'no' and 'uh'.

Ronald
-- 
Ronald Fischer (phone +49-89-63676431)
mailto:address@hidden




reply via email to

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