←Command Line/Challenge Challenge: Tidy the Downloads Folder60:00
Click the virtual machine below to start practicing
>_ Tekhnikum | Lab
Setting up virtual machine…
Preparing lab files…
Starting terminal services…
This lab machine has stopped
Your progress through the guide is saved. Start a fresh machine to keep practicing.
Introduction
No instructions this time, only a goal. Use ls, cd, mkdir, mv, cp, rm, find and friends to sort out ~/project/Downloads.
Tidy the Downloads Folder
~/project/Downloads is a mess of images, documents and temporary files.
Tasks
Inside Downloads, create the directories images, docs and archive.
Move every .jpg and .png file into images.
Move every .pdf and .txt file into docs.
Delete every .tmp file.
A hidden file somewhere under Downloads starts with .invoice. Copy it into archive under the name invoice.txt.
Requirements
Work on the command line only.
Nothing except the three new directories may be left at the top of Downloads.
Example
When you're done, the top of the folder looks like this:
$ ░░ ~/project/Downloads
archive docs images
Solution
cd ~/project/Downloads
mkdir images docs archive
mv *.jpg *.png images/
mv *.pdf *.txt docs/
rm *.tmp
find . -name ".invoice*"
cp ./old/2025/.invoice-117.txt archive/invoice.txt
rm -r old
ls
The old folder only held the hidden invoice and a temporary file, so once the invoice is copied the whole folder can go.
Summary
You sorted a real mess using only the shell: creating directories, moving files by wildcard, deleting safely, and tracking down a hidden file with find.