Board logo

标题: [求助]findstr 的若干参数用法 [打印本页]

作者: plp626     时间: 2008-1-26 15:11    标题: [求助]findstr 的若干参数用法

/L        按字使用搜索字符串。

  /OFF[LINE] 不跳过带有脱机属性集的文件。
  /F:file   从指定文件读文件列表 (/ 代表控制台)。

  /G:file   从指定的文件获得搜索字符串。 (/ 代表控制台)。
  /D:dir    查找以分号为分隔符的目录列表

看的我云里雾里.
那位能给个具体例子
findstr /l ....
findstr /off
...
就行了

[ Last edited by plp626 on 2008-1-26 at 03:20 PM ]
作者: NeverAgain     时间: 2008-2-2 03:17
findstr "computer help" myfile.txt

In the above example, any lines containing "computer help" would be printed to the screen.

findstr /s "computer help" *.txt

Similar to the first example, the above example would find any lines containing "computer help" in any txt file in the current directory and all sub directories

findstr /x /c:"computer help" *.txt

Match .txt files that contain an exact match on "computer help"; therefore, files that contain "computer helps" or other non-exact matches will not be displayed. It is important to realize that using /x must be a line that exactly matches "computer help"; in other words, if anything else is on the same line, it's not an exact match.

findstr /n /i /c:"computer help" *

Search for any file containing "computer help" regardless of its case and display the line where the text is found.
作者: Climbing     时间: 2008-2-2 10:09
chcp 437
findstr /?