Back to Blog
Arnošt Havelka

Wildcards

Magic characters for file matching.

Start Interactive Lesson
Wildcards

Understanding Wildcards

Wildcards are special characters that act as placeholders for other characters. They are incredibly powerful when you want to perform operations on groups of files rather than one at a time. The two most common are * and ?.

Usage:*
(Matches any sequence)
?
(Matches single char)
*
Matches zero or more characters. e.g. *.txt matches all text files.
?
Matches exactly one character. e.g. file?.txt matches file1.txt but not file10.txt.

Real-World Examples

List all text files:

Command Prompt
C:\Users\User>dir *.txt

Match files with a specific pattern:

Command Prompt
C:\Users\User>dir img_??.jpg

Knowledge Check

1 / 2

Which wildcard matches any number of characters?

References

These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.

Up Next

The Copy Command

Duplicate files with ease.