Sort Files with Wildcards

Linux lab Intermediate 4 tasks 20 points

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.

student@vulntech:~ Starting…
Getting your Linux machine ready…
The first start downloads about 20 MB. After that your browser keeps it, and labs start in a moment.

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}
HOME LEARN COMMUNITY DASHBOARD