|
K
E
Y |
Common Commands |
INTERNAL |
External |
/SWITCH |
Parameter |
Help text |
AddonTool |
|
Mounted Commands |
.Mount/\Command |
CmdShorthand |
#Constant |
$FUNCTION |
:Procedure |
!GuardNote |
|
Operating Systems |
NT/2K/XP/K3 |
NT Only |
NT/2K |
2K Only |
2K/XP |
XP Only |
XP/K3 |
K3 Only |
2K/XP/K3 |
|
FindStr.exe |
NT |
2K |
XP |
K3 |
|
Version |
4.0.1371.1 |
5.0.2147.1 |
5.1.2600.0 |
5.2.3790.0 |
|
Date (mm/dd/yyyy) |
10/13/1996 |
12/07/1999 |
08/23/2001 |
03/25/2003 |
|
Time (hh:mn AM/PM) |
09:38 PM |
08:00 AM |
12:00 PM |
8:00 AM |
|
Size (bytes) |
25360 |
25872 |
25088 |
26112 |
|
Local Path |
%windir%\system32\FindStr.exe
---OR--- %SystemRoot%\system32\FindStr.exe |
|
Remote Path |
\\computername\admin$\system32\FindStr.exe |
|
MD5 |
8BF63DAAEEAE996F9791EBD1464ADB42 |
2C64ED549E313BA615622BAEB1F6228A |
D6B101A75ED9BB15F4B9BB939779354F |
452C941144A5291D4D2CBE10355F988F |
There are over 400 commands available in all installations
of Windows NT4, 2000, XP and Server 2003 at the command prompt
and in batch files without adding any third party software.
Click here for the MasterCatalog.
|
Resource |
|
Short Description |
|
.FindStr |
|
.ExactName Mount/\Command for
FindStr.exe |
|
:FNL |
|
Numbers the lines in a file, optionally padding the numbers to equalize columns |
Get your FREE Advanced Version of the NT/2K/XP/K3 Command Library at ntlib.com!
Go straight to !GuardNotes. (updated
2004-07-13)
This is the Mounted Help Text. We also archive the Common Help Text
for NT,
2K, XP
and K3
Description
Searches for strings in files.
Syntax
|
FindStr |
|
[/A:color attributes] [/B] [/C:string] [/D:dir list] [/E]
[/F:file] [/G:file]
[/I] [/L] [/M] [/N] [/O] [/OFF[LINE]] [/P] [/R] [/S] [/V] [/X]
strings [[drive:][path]filename[ ...]] |
Parameters and Switches
| /A:attr |
|
Specifies color attribute with two hex digits. See "COLOR
/?" |
| /B |
|
Matches pattern if at the beginning of a line. |
| /C:string |
|
Uses specified string as a literal search string. |
| /D:dir |
|
Search a semicolon delimited list of directories |
| /E |
|
Matches pattern if at the end of a line. |
| /F:file |
|
Reads file list from the specified file(/ stands for console). |
| /G:file |
|
Gets search strings from the specified file(/ stands for console). |
| /I |
|
Specifies that the search is not to be case-sensitive. |
| /L |
|
Uses search strings literally. |
| /M |
|
Prints only the filename if a file contains a match. |
| /N |
|
Prints the line number before each line that matches. |
| /O |
|
Prints character offset before each matching line. |
| /OFF[LINE] |
|
Do not skip files with offline attribute set. |
| /P |
|
Skip files with non-printable characters. |
| /R |
|
Uses search strings as regular expressions. |
| /S |
|
Searches for matching files in the current directory and all subdirectories. |
| /V |
|
Prints only lines that do not contain a match. |
| /X |
|
Prints lines that match exactly. |
| strings |
|
Text to be searched for. |
| [drive:][path]filename |
|
Specifies a file or files to search. |
Examples, Notes and Instructions
Use spaces to separate multiple search strings unless the argument is prefixed with /C. For example, 'FindStr "hello there" x.y'
searches for "hello" or "there" in file x.y. 'FindStr /C:"hello there" x.y' searches for "hello there" in file x.y.
Regular expression quick reference:
| Wildcard: any character |
. |
| Repeat: zero or more occurances
occurrences of previous character or class |
* |
| Line position: beginning of line |
^ |
| Line position: end of line |
$ |
| Character class: any one character in set |
[class] |
| Inverse class: any one character not in set |
[^class] |
| Range: any characters within the specified range |
[x-y] |
| Escape: literal use of metacharacter x |
\x |
| Word position: beginning of word |
\<xyz |
| Word position: end of word |
xyz\> |
For full information on FindStr regular expressions refer to the online Command Reference.
GuardNotes
Things that are different (by design, by accident or otherwise)
Regular Expressions
Ranges [a-z] and [A-Z] perform INCONSISTENTLY in 2K/XP.
-------Begin (strings.txt)-------
abc
DEF
123
--------End (strings.txt)--------
Example #1 (looking for UPPER CASE only)
C:\>findstr /R [A-Z] strings.txt
DEF
Correct: returned only lines containing at least one UPPER CASE character.
abc
DEF
Incorrect: returned any alpha character, not just UPPER CASE
Example #2 (looking for lower case only)
C:\>findstr /R [a-z] strings.txt
abc
Correct: returned only lines containing at least one lower case character.
abc
DEF
Incorrect: returned any alpha character, not just lower case
|