find

Windows CMD · Text · available in the simulator

What it does

Searches for a string in a file or command output.

Syntax

find [/v] [/c] [/n] [/i] "cadena" [archivo...]

Options and parameters

  • /i

    ignores case

  • /c

    counts matching lines

  • /n

    displays line numbers

  • /v

    lines NOT containing the string

  • /V

    Displays all lines NOT containing the specified string.

  • /C

    Displays only the count of lines containing the string.

    find /c "error" log.txt
  • /N

    Displays line numbers with the matching lines.

  • /I

    Ignores the case of characters when searching.

    find /i "error" log.txt
  • /OFF

    Does not skip files with the offline attribute set.

Usage examples

  • find "error" log.txt
  • find /i "error" log.txt
  • find /c "error" log.txt

Notes and common mistakes

  • The string must be enclosed in quotation marks. For regular expressions, use findstr.
Practise find

Related commands