Welcome ! Login
Original Message
Forum MS Windows 
Topic FINDSTR native GREP for Windows XP and 2000 
Author Beavis Christ 
Date Created 9/15/2006 2:00:01 PM 
Message Ever wanted to GREP something in windows but don't want to install any additional tools.

Use the command FINDSTR at a command prompt.

You can also send the searched info to a file with >c:\yourfile.txt

Tested with Windows XP and 2000

****Syntax****

findstr [/b] [/e] [/l] [/r] [/s] [/i] [/x] [/v] [/n] [/m] [/o] [/p] [/offline] [/g:file] [/f:file] [/c:string] [/d:dirlist] [/a:ColorAttribute] [strings] [[Drive:][Path] FileName [...]]


****Parameters****

/b : Matches the pattern if at the beginning of a line.

/e : Matches the pattern if at the end of a line.

/l : Uses search strings literally.

/r : Uses search strings as regular expressions. Findstr interprets all metacharacters as regular expressions unless you use /l.

/s : Searches for matching files in the current directory and all subdirectories.

/i : Specifies that the search is not to be case-sensitive.

/x : Prints lines that match exactly.

/v : Prints only lines that do not contain a match.

/n : Prints the line number before each line that matches.

/m : Prints only the file name if a file contains a match.

/o : Prints seek offset before each matching line.

/p : Skips files with non-printable characters.

/offline : Processes files with offline attribute set.

/f:file : Reads file list from the specified file.

/c:string : Uses specified text as a literal search string.

/g:file : Gets search strings from the specified file.

/d:dirlist : Searches a comma-delimited list of directories.

/a:ColorAttribute : Specifies color attributes with two hexadecimal digits.

strings : Specified text to be searched for in FileName.

[Drive:][Path] FileName [...] : Specifies a file or files to search.

/? : Displays help at the command prompt.

 
      
Responses
No records
Home Recipes Links Blog Forums Join Us