Sort Files with Wildcards
The camera directory holds photos, videos and logs all mixed up. Sort them using wildcards: one command per job, no typing file names one by one.
How it works: the terminal below is a real Linux machine running in your browser. Click it and
type. Tasks tick themselves off as you complete them; questions are answered in the box under each task.
Press Reset any time for a fresh machine. Your password on this machine (for
sudo) is student.
Hints
Preview a pattern with ls or echo before you move or delete.
Solution explanation
Wildcards are case-sensitive, so *.jpg and *.JPG are different patterns (one mv can take both). log-2023-* matches only the 2023 logs. Braces generate the three directory names.
Show solution
cd camera
mv *.jpg *.JPG photos/
mv *.mp4 videos/
rm log-2023-*
mkdir -p albums/{jan,feb,mar}