WORK 102 words
Generate a Shell Script to Clean Up a Messy Downloads Folder
The Downloads folder has become a landfill of installers, screenshots, and PDFs named final final v2, and manually sorting it is not how you want to spend an afternoon. This writes a script that files everything by type, skips duplicates on repeat runs, and explains itself well enough for you to adjust the rules later.
Write a shell script that tidies up my Downloads folder by sorting files into subfolders by type: documents (pdf, doc, docx), images (jpg, png, gif), archives (zip, rar), and installers (dmg, exe, pkg). Anything that does not match a known type should go into a misc folder rather than being left where it is. The script should be safe to run more than once without duplicating or overwriting files, should print a short summary of what it moved, and should work on [macOS or Linux, specify which]. Add comments explaining each section so I can tweak the file-type rules myself later.
⚠ human-in-the-loop: you are responsible for the results of using this prompt, not us.