Think of Shell Expansion as the "translator" that sits between what you type and what the computer actually executes.
Before a command like ls or touch even starts to run, the Shell (the program reading your typing) scans your line for special characters and "expands" them into their full, literal meaning.
Step 1 { }
Use touch command create log file.
touch log_{2024..2025}_{Jan,Feb,Mar}.txt
Display created file
ls
Step 2 *
Matches zero or more characters in filenames.
ls log_2024_*
Step 3 [ ]
Matches one character from a specific set/range
ls log_202[45]_Mar.txt
Step 4 ?
Matches exactly one character in filenames.
ls log_202?_Mar.txt
Step 5 $()
Command inside $() will be execute first
The shell runs date +%Y-%m-%d first, receives the text (e.g., 2026-03-16), and then hands that text to touch
touch report_$(date +%Y-%m-%d).txt
Display created file
ls
student@localhost:~$ touch log_{2024..2025}_{Jan,Feb,Mar}.txt
student@localhost:~$ ls
Desktop Downloads log_2024_Jan.txt log_2025_Feb.txt log_2025_Mar.txt Pictures Templates
Documents log_2024_Feb.txt log_2024_Mar.txt log_2025_Jan.txt Music Public Videos
student@localhost:~$ ls log_2024_*
log_2024_Feb.txt log_2024_Jan.txt log_2024_Mar.txt
student@localhost:~$ ls log_202[45]_Mar.txt
log_2024_Mar.txt log_2025_Mar.txt
student@localhost:~$ ls log_202[45]_Mar.txt
log_2024_Mar.txt log_2025_Mar.txt
student@localhost:~$ touch report_$(date +%Y-%m-%d).txt
student@localhost:~$ ls
Desktop Downloads log_2024_Jan.txt log_2025_Feb.txt log_2025_Mar.txt Pictures report_2026-03-16.txt Videos
Documents log_2024_Feb.txt log_2024_Mar.txt log_2025_Jan.txt Music Public Templates