Findstr



ʹóʽļеıģʽ


﷨



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 [...]]






	/b

	λеĿͷƥģʽ

	/e

	λеĩβƥģʽ

	/l

	ʹַ

	/r

	ʹΪʽFindstr ԪַΪʽʹ /l

	/s

	ڵǰĿ¼Ŀ¼ƥļ

	/i

	ִָСд

	/x

	ӡȫƥС

	/v

	ֻӡƥС

	/n

	ÿƥ֮ǰӡкš

	/m

	ļƥӡļ

	/o

	ÿƥ֮ǰӡƫ

	/p

	ǿɴӡַļ

	/offline

	ѻôļ

	/f:file

	ָļжȡļб

	/c:string

	ʹָıΪַ

	/g:file

	ָļõַ

	/d:dirlist

	ԶŷָĿ¼б

	/a:ColorAttribute

	ʹʮָɫԡ

	strings

	ָҪ FileName ı

	[Drive:][Path] FileName [...]

	ָҪļ

	/?
ʾʾ



ע


  findstr ʹóʽ
	
Findstr κ ASCII ļļоȷҪҵıȻʱҪƥϢֻһֻҪҸϢΧ£findstr ʹóʽıǿܡ

 ʽָı͵ķţ뾫ȷַ෴ʹַԪַÿڳıʽ﷨ûֵַַĸַƥ䡣磬ĸַšԪַڳʽ﷨о壨ָķš


±г findstr ܵԪַ


ַ
ֵ


.
ͨκַ


*
ظǰַλγ


^
λãеĿʼ


$
λãеĽβ


[class]
ַࣺκһַ


[^class]
ࣺڼеκһַ


[x-y
ΧΧָΧڵκַ


\x
ȡԪַ x ;


\<xyz
λã


xyz>
λãβ



 ʽ﷨ַһʹʱǿ磬ƥַͨ (.) ظ (*) ϣ

 .*

 ±ʽƥԡbͷԡingβκַĸʽɲ֣

 b.*ing
    








ÿոַָǲ /c Ϊǰ׺Ҫļ x.y hellothere룺

 findstr "hello there" x.y

Ҫļ x.y hello there룺

 findstr /c:"hello there" x.y


 Ҫļ Proposal.txt гֵеʡWindowsĸ W д룺

 findstr Windows proposal.txt

 Ҫ Windows ĵǰĿ¼Ŀ¼еÿļĸСд

 findstr /s /i Windows *.*

 ҪҰ֡FORУǰĿո磺еѭÿγֵкţ룺

 findstr /b /n /c:"*FOR" *.bas

 ҪͬļͬĿ봴ϰÿ׼ıļҲгҪıļȷļҪʹļ Finddata.txt е Filelist.txt гļȻ󽫽浽ļ Results.out У룺

 findstr /g:finddata.txt /f:filelist.txt > results.out

 ҪҵǰĿ¼Ŀ¼ÿcomputerʵļĸĴСдҪгʡcomputerļ룺

findstr /s /i /m "\<computer\>" *.*

 ڼٶҪ֡computerҪĸcompͷ֣硰compliment͡compete룺

 findstr /s /i /m "\<comp.*" *.*

XOX



