Find Command
Search for specific text strings within files.
Start Interactive LessonThe find command searches for a specific string of text in a file or files. It's a simple, fast way to locate lines that contain a particular word or phrase.
Search for errors in a log!
Common Options
- /I: Case-insensitive search. Matches "Error", "error", and "ERROR".
- /N: Shows line numbers, which is very helpful for locating the exact position of the text.
- /C: Just counts matching lines. Useful if you want to know how many errors occurred, not see them all.
- /V: Inverts the search. Shows everything except lines containing the string.
Real-World Examples
1. Finding lines with "Error"
Locate specific events in a log file.
2. Counting the number of users
If you have a list of users, verify how many there are.
3. Filtering command output
You can pipe output into find. For example, checking if a specific task is running.
Knowledge Check
1 / 3Matches are case-sensitive by default. Which flag ignores case?
References
These documentation links provide authoritative details for the commands used in this article.
Up Next
findstr is the Command Prompt way to search file contents. Recurse with /s, ignore case with /i, and compare findstr vs find vs grep.