HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

find — Find a specified string in files. More information: <https://learn.microsoft.com/windows-server/admi

Submitted by: @import:tldr-pages··
0
Viewed 0 times
commandfilesfindclistringspecifiedmore
windows

Problem

How to use the find command: Find a specified string in files. More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/find>.

Solution

find — Find a specified string in files. More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/find>.

Find lines that contain a specified string:
find "{{string}}" {{path\to\file_or_directory}}


Display lines that do not contain the specified string:
find "{{string}}" {{path\to\file_or_directory}} /v


Display the count of lines that contain the specified string:
find "{{string}}" {{path\to\file_or_directory}} /c


Display line numbers with the list of lines:
find "{{string}}" {{path\to\file_or_directory}} /n

Code Snippets

Find lines that contain a specified string

find "{{string}}" {{path\to\file_or_directory}}

Display lines that do not contain the specified string

find "{{string}}" {{path\to\file_or_directory}} /v

Display the count of lines that contain the specified string

find "{{string}}" {{path\to\file_or_directory}} /c

Display line numbers with the list of lines

find "{{string}}" {{path\to\file_or_directory}} /n

Context

tldr-pages: windows/find

Revisions (0)

No revisions yet.