2018-06-21 13:06:00 +01:00
|
|
|
# find
|
|
|
|
|
|
|
|
> Find a specified string in one or more files.
|
2022-10-04 16:06:23 +01:00
|
|
|
> More information: <https://learn.microsoft.com/windows-server/administration/windows-commands/find>.
|
2018-06-21 13:06:00 +01:00
|
|
|
|
|
|
|
- Find lines that contain a specified string:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`find "{{string}}" {{path\to\file_or_directory}}`
|
2018-06-21 13:06:00 +01:00
|
|
|
|
|
|
|
- Display lines that do not contain the specified string:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`find "{{string}}" {{path\to\file_or_directory}} /v`
|
2018-06-21 13:06:00 +01:00
|
|
|
|
|
|
|
- Display the count of lines that contain the specified string:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`find "{{string}}" {{path\to\file_or_directory}} /c`
|
2018-06-21 13:06:00 +01:00
|
|
|
|
|
|
|
- Display line numbers with the list of lines:
|
|
|
|
|
2023-02-20 07:23:49 +00:00
|
|
|
`find "{{string}}" {{path\to\file_or_directory}} /n`
|