The find command allows you to search for text within a file. Although MS-DOS is not case-sensitive, when typing in the string, you'll need to make sure that you're using the correct case.
Additionally, this command is used to find text within a file, not the actual file itself. If you want to search or find a file with a particular name, use the dir command.
如果您使用的是Windows XP或更高版本,请考虑使用改进的findstr命令。
If you're running Windows XP or later, consider using the improved findstr command.
The example above would find any "REM" statement in the autoexec.bat.
find /v /c "&*fake&*" programs.txt
List each line not containing "&*fake&*," because it's very unlikely that any file would containing this string of text this would give you an accurate line count of the file.
find "hope" *.txt
The next example searches for any text file (.txt) that contains the text hope in the current directory. As can be seen in the output below, the only file that contains hope is the CH.TXT file.
find (在文件中搜索文本)
使用find命令可以在文件中搜索文本。尽管MS-DOS不区分大小写,但在键入字符串时,您需要确保使用正确的大小写。 此外,此命令用于在文件中查找文本,而不是实际文件本身。如果要搜索或查找具有特定名称的文件,请使用dir命令。
The find command allows you to search for text within a file. Although MS-DOS is not case-sensitive, when typing in the string, you'll need to make sure that you're using the correct case. Additionally, this command is used to find text within a file, not the actual file itself. If you want to search or find a file with a particular name, use the dir command.
如果您使用的是Windows XP或更高版本,请考虑使用改进的findstr命令。
If you're running Windows XP or later, consider using the improved findstr command.
查看英文版
查看中文版
1 find 运行系统环境
2 find 语法
3 find 示例
find 运行系统环境
Windows 95
Windows 98
Windows xp
Windows vista
Windows 2000
Windows 7
Windows 8
Windows 10
Windows NT
Windows ME
All Versions of MS-DOS
find 语法
Windows Vista 和更高版本的语法
如果未指定路径名,FIND将搜索在提示符处输入的文本或从另一个命令通过管道输入的文本。
Windows XP和以前的语法
如果未指定路径名,FIND将搜索在提示符处输入的文本或从另一个命令通过管道输入的文本。
Windows Vista and later syntax
If a pathname is not specified, FIND searches the text typed at the prompt or piped from another command.
Windows XP and earlier syntax
If a pathname is not specified, FIND searches the text typed at the prompt or piped from another command.
查看英文版
查看中文版
find 示例
上面的示例将在autoexecute .bat中找到任何“REM”语句。
列出不包含"&*fake&* "的每一行,因为任何文件都不可能包含这个文本字符串,这将给您一个文件的准确行数。
下一个示例在当前目录中搜索包含希望文本的任何文本文件(.txt)。从下面的输出中可以看到,唯一包含hope的文件是CH.TXT文件。
---------- ACTIVE SETUP LOG.TXT
---------- CH.TXT
computer hope
---------- MODEMDET.TXT
---------- OEWABLOG.TXT
---------- SCHEDLGU.TXT
---------- SETUPLOG.TXT
The example above would find any "REM" statement in the autoexec.bat.
List each line not containing "&*fake&*," because it's very unlikely that any file would containing this string of text this would give you an accurate line count of the file.
The next example searches for any text file (.txt) that contains the text hope in the current directory. As can be seen in the output below, the only file that contains hope is the CH.TXT file.
---------- ACTIVE SETUP LOG.TXT
---------- CH.TXT
computer hope
---------- MODEMDET.TXT
---------- OEWABLOG.TXT
---------- SCHEDLGU.TXT
---------- SETUPLOG.TXT
查看英文版
查看中文版
其他命令行
fasthelp | fc | fciv | fdisk | findstr | fixboot | fixmbr | for | forfiles | format | ftp | ftype |