Menu
Coddy logo textTech

Recap - Selective Operations

Part of the Fundamentals section of Coddy's Terminal journey — lesson 29 of 82.

challenge icon

Challenge

Easy

Put all your wildcard skills together!

  1. Create a new directory called archive using mkdir
  2. Move only the single-digit .jpg photo files into archive/ using the [0-9] bracket wildcard
  3. Move all report_?.txt files into archive/ using the ? wildcard
  4. Delete all remaining .png files using the * wildcard
  5. List the home directory with ls to confirm what remains
  6. List the archive folder with ls archive to confirm its contents

Note: photo_10.jpg should stay in the home directory — it has two digits so it won't be matched by [0-9]. Think carefully about which wildcard to use for each step!

⚠ Clean up first: If you see unexpected directories (like family, nature, or travel) in your home directory — possibly left over from a previous lesson — remove them before running the steps above. Use rm -rf <dirname> for each one (for example, rm -rf family). This ensures your ls output matches the expected result.

Try it yourself

Terminal

All lessons in Fundamentals