Jump to content

Find (Windows)

From Alfawiki
FIND command
Company typeCommand-line utility
IndustryComputing / Software
Founded1983
ProductsText searching in files
OwnerMicrosoft (primarily)
ParentMS-DOS, Windows, ReactOS, OS/2

In computing, the find command is utilized within the command-line interpreter environments (shells) across various operating system platforms. Its primary function is to locate a designated text string inside files and then output the lines that contain the matches to the standard output.

Overview

The find utility processes input lines, selecting those that either include or exclude a particular string, and directs the filtered results to the output. It does not accommodate the use of wildcard characters.

This command is implemented in systems such as DOS, Digital Research’s FlexOS, IBM/Toshiba’s 4690 OS, IBM OS/2, Windows, and ReactOS. Within MS-DOS, it has been part of the system since version 2. Additionally, versions exist in DR DOS 6.0 and Datalight’s ROM-DOS. The FreeDOS variant, created by Jim Hall, is distributed under the terms of the GPL.

It is important to note that the Unix find command performs a different role, more akin to Windows’ forfiles. The Unix tool most comparable to Windows find is grep.

Syntax

<syntaxhighlight lang="text"> FIND [/V] [/C] [/N] [/I] "string" [[drive:][path]filename[...]] </syntaxhighlight>

Parameters:

  • "string" Defines the text sequence to search for.
  • [drive:][path]filename Indicates the file or files in which to perform the search.

Options:

  • /V Outputs lines that do not include the specified string.
  • /C Provides a count of lines where the string appears.
  • /N Shows line numbers alongside matching lines.
  • /I Conducts a case-insensitive search.

Note: When no specific pathname is provided, FIND examines text entered directly via the prompt or received through a pipeline from another command.

Examples

<syntaxhighlight lang="doscon"> C:\>find "keyword" < inputfilename > outputfilename </syntaxhighlight>

<syntaxhighlight lang="doscon"> C:\>find /V "any string" FileName </syntaxhighlight>

See also

  • Findstr, a tool in Windows and ReactOS for searching patterns within files.
  • find (Unix), a Unix utility for locating files based on attributes, differing from Windows find.
  • grep, a Unix command used for pattern searching, similar in purpose to Windows find.
  • forfiles, a Windows command for finding files by attribute, analogous to Unix find.
  • Regular expression
  • List of DOS commands

Further reading

  • Jim Cooper, Special Edition Using MS-DOS 6.22, Third Edition, Que Publishing, 2001.
  • Kathy Ivens & Brian Proffit, OS/2 Inside & Out, Osborne McGraw-Hill, 1993.
  • Æleen Frisch, Windows 2000 Commands Pocket Reference, O'Reilly Media, 2001.

External links