Back to Blog
Arnošt Havelka

Wildcards

Magic characters for file matching.

Start Interactive Lesson
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 ?.

Try the command

Try using a wildcard pattern!

Build the command
dir
?Matches exactly one character. e.g. file?.txt matches file1.txt but not file10.txt.
Terminal
C:\Users\User>dir *.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 documentation links provide authoritative details for the commands used in this article.

Up Next

The Copy Command

Duplicate files with ease.