Findstr Command In Windows Server 2008

This article shows how to use Findstr command in Windows Server 2008 operating system and syntax related with it.
  • 3183

Introduction

Findstr command is short for find string. This command is used to searches for patterns of text in files. Syntax for using Findstr command is given below.

Syntax

findstrn [/b] [/e] [/l] [/r] [/s] [/i] [/x] [/v] [/n] [/m] [/o] [/p] [/f : <File>] [/c : <String>] [/g : <File>] [/d : <DirList>] [/a : <ColorAttribute>] [/off[line]] <Strings> [<Drive>:] [<Path>] <FileName> [ . . . ]

Parameters For Findstr

Parameter Description
/b Matches the text pattern if it is at the beginning of a line.
/e Matches the text pattern if it is at the end of a line.
/l Processes search strings literally.
/r Processes search strings as regular expressions.
/s Searches the current directory and all subdirectories.
/i Ignores the case of the characters when searching for the string.
/x Prints lines that match exactly.
/v Prints only lines that do not contain a match.
/n Prints the line number of each line that matches.
/m Prints only the file name if a file contains a match.
/o Prints character offset before each matching line.
/p Skips files with non-printable characters.
/off[line] Does not skip files that have the offline attribute set.
/f:<File> Gets a file list from the specified file.
/c:<String> Uses the specified text as a literal search string.
/g:<File> Gets search strings from the specified file.
/d:<DirList> Searches the specified list of directories.
/a:<ColorAttribute> Defines color attributes with two hexadecimal digits.
<Strings> Defines the text to search for in FileName.
[<Drive>:][<Path>]<FileName>[ ...] Defines the location and file or files to search.
/? Shows help at the command prompt.

Ask Your Question

Got a programming related question? You may want to post your question here

Programming Answers here

Categories

More Articles

© 2020 DotNetHeaven. All rights reserved.