Tsallaka zuwa abun ciki
Justice Tech School

Wildcards and Brace Expansion

* matches any text, ? one character and [abc] a set. Braces expand lists and ranges, so {a,b} and {1..3} generate words. Quote patterns you want passed to the command untouched.

Example
mkdir -p g && cd g
touch a1.txt a2.txt b1.log
ls *.txt
ls ?1.*
ls [ab]1*
echo file{1..3}.md
echo {a,b}{x,y}
cd .. && rm -r g

Result

a1.txt
a2.txt
a1.txt
b1.log
a1.txt
b1.log
file1.md file2.md file3.md
ax ay bx by

Exercise

Match any text.

ls .txt

Quiz Test

What does {1..3} do?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.