find命令
用于在文件中搜索
字符串
。
FIND [/V] [/C] [/N] [/I] [/OFF[LINE]] "string" [[drive:][path]filename[
/V
显示所有未包含指定字符串的行。
/C
仅显示包含字符串的行数。
/N
显示行号。
/I
搜索字符串时忽略大小写。
/OFF[LINE]
不要跳过具有脱机属性集的文件。
"string"
指定要搜索的文字串,
[drive:][path]filename
指定要搜索的文件。
如果没有指定路径,FIND 将搜索键入的或者由另一命令产生的文字。
实例1
:
find /n "hubin" *.txt
注1
:字符串要用""括起来
<wbr style="line-height:25px"><span style="line-height:25px; font-family:Arial,Helvetica,simsun,u5b8bu4f53"><span style="line-height:25px">注3</span>:<span style="color:#000080; line-height:25px">find命令还会列出没有包含字符串的文件。比如:---------- 1.TXT。</span></span> <div style="line-height:25px"> <span style="line-height:25px; font-family:Arial,Helvetica,simsun,u5b8bu4f53"><span style="color:#000080; line-height:25px">如果只想</span></span><span style="line-height:25px; font-family:Arial,Helvetica,simsun,u5b8bu4f53"><span style="color:#000080; line-height:25px">列出包含字符串的文件并</span></span><span style="line-height:25px; color:rgb(0,0,128)">子目录中查找请使用我的DOS脚本库《<strong><a title="阅读全文" target="_blank" href="http://hubingforever.blog.163.com/blog/static/1710405792011452730840/" style="color:rgb(207,121,28); line-height:25px; text-decoration:none">findFile</a></strong></span><span style="line-height:25px; color:rgb(0,0,128)">》</span> </div> </wbr>