中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-18 02:28
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [求助]findstr 的若干参数用法 查看 1,023 回复 2
楼 主 [求助]findstr 的若干参数用法 发表于 2008-01-26 15:11 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
积分 2,278
发帖 1,020
注册 2007-11-19 13:34
UID 103127
性别 男
状态 离线
/L 按字使用搜索字符串。

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

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

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

[ Last edited by plp626 on 2008-1-26 at 03:20 PM ]
2 发表于 2008-02-02 03:17 ·  中国 陕西 西安 电信
初级用户
积分 67
发帖 40
注册 2008-01-31 23:57
UID 109932
性别 男
状态 离线
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.
3 发表于 2008-02-02 10:09 ·  中国 河北 保定 联通
铂金会员
★★★★
网络独行侠
积分 6,962
发帖 2,753
注册 2003-04-16 00:00
UID 1565
性别 男
来自 河北保定
状态 离线
chcp 437
findstr /?
偶只喜欢回答那些标题和描述都很清晰的帖子!
如想解决问题,请认真学习“这个帖子”和“这个帖子”并努力遵守,如果可能,请告诉更多的人!
论坛跳转: