CMD Master
Back to Blog
Arnošt Havelka

Find Command

Search for specific text strings within files.

Start Interactive Lesson
Find Command

Find Command

The 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.

Usage:find
[/options]
"string"
[filename]
/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.

Common Options

Real-World Examples

1. Finding lines with "Error"

Locate specific events in a log file.

Command Prompt
C:\Users\User>find "Error" app.log

2. Counting the number of users

If you have a list of users, verify how many there are.

Command Prompt
C:\Users\User>find /c "User:" users.txt

3. Filtering command output

You can pipe output into find. For example, checking if a specific task is running.

Command Prompt
C:\Users\User>tasklist | find "notepad"

Knowledge Check

1 / 3

Matches are case-sensitive by default. Which flag ignores case?

Up Next

Clip Command

Copy command output directly to your clipboard.