The Search Dialog
The Search Dialog is where you specify what you want to search for and where you want to search for it.

The Pattern Tab
Use the Pattern tab to specify the string or regular expression (regexp) you want to search for. You can also specify some search options. This is what it looks like:

Back to the Help Contents

Strings and regexps
In most cases, you'll simply want to type in the string that you're looking for in the String or Regexp field. If you want to enter a regular expression, simply enclose it inside apostrophies. For example, if I wanted to search for my name, Keith, with an, arcane regexp I would type in: 'Ke[a-z]*h\+' . If you want more information on regexps, type in man grep or info grep at your konsole window and read through the corresponding section.

Back to the Help Contents

Pattern files
You can also use a file containing patterns (one-per-line) to match from. A line matching any one of the patterns will be returned during the search. For example, if I want to search for all occurances of Keith (with my regexp) and Widget (as a string) I could create a file pats that looked like this:
        % cat pats
        Ke[a-z]*h\+
        Widget
        %
        
I would then type the name of the file in the edit field or use the Browse... button to locate it, specify my location and click OK. Note: it seems to me that a feature =) of GNU grep is that you don't specify the apostrophies around regexps in pattern files unlike you do for direct entry. Try it both ways. One way or the other is bound to work.

Back to the Help Contents

Search options
Case sensitive
This one is pretty obvious. It allows you to mandate case sensitive matching of your search strings. This option has no effect on regexps.

Show lines that *do not* match
I've never found a use for it, but I guess some people like to find inverse matches. Check this item if you want all lines that do not match your search pattern.

Require whole word to match
Check this box if a match to your search pattern must be a whole word (i.e. is bounded on each side by a whitespace character: space, tab, newline, etc...).

Require whole line to match
Again, self-explanatory. Check this box if a match to your pattern must be an entire line in a file.

Don't supress binary data
DANGER Will Robinson! You better have a very good reason for checking this box. This generates insanely large amounts of data if you aren't very careful. I'm not even sure this is useful in a GUI front-end but is provided here for completeness.

Back to the Help Contents

The Location Tab
Use the Location tab to specify where you want to search at. You can specify either file(s) or directory(s) to search. Here is what it looks like:

Back to the Help Contents

Searching files
You may specify any number of files in the File(s) edit field. As you can see, wildcards are supported. Using the Browse... button to add files will not overwrite the existing entries. Any files selected in the file locator dialog will simply be appended to the list already in the edit field. Note: if you launch KGrep from a KPanel applnk or from a desktop applnk, it is run out of your home directory. For instance, say I launched KGrep from a KPanel applnk, and I wanted to search all the Qt header files on my system, I could specify /usr/include/qt/*.h in the File(s) edit.

Back to the Help Contents

Searching directories
The Directory(s) edit field allows you to specify a directory to search. Unlike the File(s) edit field, you may only specify one directory at a time in this field. The Browse... button will overwrite the existing entry if you OK the directory locator dialog. Trailing / is optional for manually entered directories.

Check the Recurse Sub-directory(s) box if you want to perform a recursive search of all the files in all the sub-directories of the selected directory. Note: only visible files are searched (i.e. those not beginning with a period).

Back to the Help Contents


Copyright © 1999 Logikos Systems and Software, Inc.