Purpose:Search files for the specified text

 

Format:FSEARCH [/= /+n /-n /8 /B /C /E"regex" /F /G /H /I /L /N[dehjs] /Q /S[[+]n] /T"text" /U /V /Y /Z] [path] filename

 

Usage:

 

FSEARCH is a modern replacement for the aged FFIND. New features will only be implemented in FSEARCH, not FFIND.

 

FSEARCH will automatically determine the file type (ASCII, UTF8, or UTF16). You can also tell FSEARCH to assume UTF8 files with the /8 option. (This is slightly faster because FSEARCH doesn't have to pre-scan the files trying to determine the encoding.)

 

You can use TCC extended wildcards in the search string. For example, the following command will find .TXT files which contain either the string June or July. It will also find Juny and Jule. The /C option makes the search case-sensitive:

 

fsearch /c /t"Ju[nl][ey]" *.txt

 

You can also search using regular expressions using the /E option. See Regular Expression Syntax for supported expressions.

 

When you use FSEARCH on an LFN drive, you must quote any file names which contain white space or special characters.

 

FSEARCH sets three internal variables:

 

_fsearch_errors - Errors when running FSEARCH (i.e., file/path not found, file locked, access denied, etc.)

 

_fsearch_files - The number of files containing one or more matches

 

_fsearch_matches - The total number of matches

 

Options:

 

/=Display the FSEARCH dialog

 

/+nSkip the first n matches

 

/-nStop after n matches

 

/8Instead of scanning the files for their type, they are assumed to be UTF8 (this is a little faster).

 

/BOnly display filenames (no header or footer or summary or matching lines)

 

/CMatch case

 

/E"..."Regular expression search

 

/FStop after first match (overrides /V)

 

/GChange to the directory containing the first matching file (also sets /F and overrides /V)

 

/HDon't search for text in binary files. By default, this includes .exe, .dll, .sys, .chm, .zip, .pdb, .pch, .obj, .tar, .com, and .ewriter. You can define your own list by setting the "BINARY_FILES" environment variable.

 

For example, to ignore .exe, .sys, and .dll files:

 

BINARY_FILES=.exe;.sys;.dll

 

/IUsed with /T to tell FSEARCH to ignore wildcard characters (*, ?, and [...]).

 

/LDisplay line numbers for matching text

 

/N...Disable options:

 

DDon't scan hidden subdirectories
EDon't display errors
HNo header
JSkip junctions
SNo footer (summary)

 

/QDon't display any output. The internal variables (see below - _fsearch_errors, _fsearch_files, and _fsearch_matches are set).

 

/SSearch subdirectories of the specified (or default) path.

 

If you specify a number following the /S, FFIND will limit the subdirectory recursion to the number specified. For example, if you have a directory tree "\a\b\c\d\e", /S2 will only go to the "a", "b", and "c" directories.

If you specify a + followed by a number after the /S, FFIND will not search for files until it gets to that depth in the subdirectory tree. For example, if you have a directory tree \a\b\c\d\e, /S+2 will not find anything in \a or \a\b.

 

/T"..."Search for the matching text. Supports TCC wildcards (?, *, and [...]).

 

/UOnly display summary line (no filenames or matching lines; overrides /V)

 

/VDisplay all matching text (FFIND defaults to only displaying the first match in each file)

 

/YDisplay a "Continue Y/N" prompt after displaying each match

 

/ZHighlight the matched text