find (Windows)

{{Short description|Command}}

{{lowercase}}

{{Infobox software

| name = find

| logo =

| screenshot = ReactOS-0.4.13 find command 667x434.png

| screenshot size =

| caption = The ReactOS find command

| developer = Microsoft, IBM, DR, Datalight, Novell, Jim Hall, ReactOS Contributors

| released = {{Start date and age|1983|03}}

| latest release version =

| latest release date =

| programming language = MS-DOS: x86 assembly language
FreeDOS, ReactOS: C

| operating system = MS-DOS, PC DOS, FlexOS, SISNE plus, DR DOS, ROM-DOS, FreeDOS, 4690 OS, Windows, OS/2, eComStation, ArcaOS, ReactOS

| platform = Cross-platform

| genre = Command

| license = MS-DOS: MIT
FreeDOS, ReactOS: GPLv2+

| website =

}}

In computing, find is a command in the command-line interpreters (shells) of a number of operating systems. It is used to search for a specific text string in a file or files. The command sends the specified lines to the standard output device.{{Cite web

|first1=Tim

|last1=Paterson

|author-link1=Tim Paterson

|title=Microsoft DOS V1.1 and V2.0: /msdos/v20source/FIND.ASM

|url=http://www.computerhistory.org/atchm/microsoft-research-license-agreement-msdos-v1-1-v2-0/

|publisher=Computer History Museum, Microsoft

|date=2013-12-19

|orig-year=1983

|access-date=2015-10-01

}}{{Cite web

|url=http://www.computerhistory.org/atchm/microsoft-ms-dos-early-source-code/

|title=Microsoft MS-DOS early source code

|series=Software Gems: The Computer History Museum Historical Source Code Series

|first=Len

|last=Shustek

|date=2014-03-24

|access-date=2015-10-01}}

Overview

The find command is a filter to find lines in the input data stream that contain or don't contain a specified string and send these to the output data stream. It does not support wildcard characters.{{Cite web|url=https://ss64.com/nt/find.html|title=Find - Search for text - Windows CMD - SS64.com|website=ss64.com}}

The command is available in DOS,{{Citation

| last1 = Jamsa

| first1 = Kris A.

| title = DOS: The Complete Reference

| publisher = Osborne McGraw-Hill

| page = 206

| year = 1993

| isbn = 0078819040

| url = https://books.google.com/books?id=UW9GAAAAYAAJ

| postscript= .

}} Digital Research FlexOS,{{cite web |url=http://www.bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |title=FlexOS User's Guide |date=1986 |website=www.bitsavers.org |access-date=2020-09-14 |archive-date=2019-09-25 |archive-url=https://web.archive.org/web/20190925131719/http://bitsavers.org/pdf/digitalResearch/flexos/1073-2003_FlexOS_Users_Guide_V1.3_Nov86.pdf |url-status=dead }} IBM/Toshiba 4690 OS,{{cite web |url= https://archive.org/details/4690OSV6r2UsersGuide/page/n169|title=Users guide|website=archive.org|access-date=2020-09-14}} IBM OS/2,{{Cite web |url=http://www.jatomes.com/Help/Os2Cmd.php#FIND |title=JaTomes Help - OS/2 Commands |access-date=2019-07-20 |archive-date=2019-04-14 |archive-url=https://web.archive.org/web/20190414130029/http://www.jatomes.com/Help/Os2Cmd.php#FIND |url-status=dead }} Microsoft Windows,{{Cite web |url=https://technet.microsoft.com/en-us/library/bb490906.aspx |title=Find |access-date=2017-08-26 |archive-date=2017-08-26 |archive-url=https://web.archive.org/web/20170826163346/https://technet.microsoft.com/en-us/library/bb490906.aspx |url-status=dead }} and ReactOS.{{Cite web|url=https://github.com/reactos/reactos|title=reactos/reactos|website=GitHub|date=3 January 2022}} On MS-DOS, the command is available in versions 2 and later.{{Cite book|author-last=Wolverton|author-first=Van|title=Running MS-DOS Version 6.22 (20th Anniversary Edition), 6th Revised edition|date=2003|publisher=Microsoft Press|isbn=0-7356-1812-7}} DR DOS 6.0[https://www.4corn.co.uk/archive/docs/DR%20DOS%206.0%20User%20Guide-opt.pdf DR DOS 6.0 User Guide Optimisation and Configuration Tips] and Datalight ROM-DOS{{Cite web|url=https://www.datalight.com/assets/files/ROM-DOS_Users_Guide.pdf|title=Datalight ROM-DOS User's Guide|website=www.datalight.com}} include an implementation of the {{code|find}} command. The FreeDOS version was developed by Jim Hall and is licensed under the GPL.{{Cite web|url=http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/repos/pkg-html/find.html|title=ibiblio.org FreeDOS Package -- find (FreeDOS Base)|website=www.ibiblio.org}}

The Unix command find performs an entirely different function, analogous to forfiles on Windows. The rough equivalent to the Windows find is the Unix grep.{{Cite web|url=https://www.tipsandtricks-hq.com/equivalent-of-unix-grep-command-in-doswindows-726|title=Equivalent of UNIX Grep command in Dos/Windows|date=January 26, 2009}}

Syntax

FIND [/V] [/C] [/N] [/I] "string" drive:][path]filename[...

Arguments:

  • "string" This command-line argument specifies the text string to find.
  • [drive:][path]filename Specifies a file or files in which to search the specified string.

Flags:

  • /V Displays all lines NOT containing the specified string.
  • /C Displays only the count of lines containing the string.
  • /N Displays line numbers with the displayed lines.
  • /I Ignores the case of characters when searching for the string.

Note:

If a pathname is not specified, FIND searches the text typed at the prompt

or piped from another command.

Examples

C:\>find "keyword" < inputfilename > outputfilename

C:\>find /V "any string" FileName

See also

  • Findstr, Windows and ReactOS command-line tool to search for patterns of text in files.
  • find (Unix), a Unix command that finds files by attribute, very different from Windows find
  • grep, a Unix command that finds text matching a pattern, similar to Windows find
  • forfiles, a Windows command that finds files by attribute, similar to Unix find
  • Regular expression
  • List of DOS commands

References

{{Reflist}}

Further reading

  • {{Cite book|author-last=Cooper|author-first=Jim|title=Special Edition Using MS-DOS 6.22, Third Edition|date=2001|publisher=Que Publishing|isbn=978-0789725738}}
  • {{Cite book|author1=Kathy Ivens|author2=Brian Proffit|year=1993|title=OS/2 Inside & Out|publisher=Osborne McGraw-Hill|isbn=978-0078818714}}
  • {{Cite book|first=Æleen|last=Frisch|year=2001|title=Windows 2000 Commands Pocket Reference|publisher=O'Reilly|isbn=978-0-596-00148-3}}