I am using the program hazel to tidy my downloads folder every time a file is downloaded. I am now telling it to run a shell script, every week, to delete every folder in my downloads folder and then recreate it.
Is there an easier way to do this (deleting folders/recreating folders) by re-iterating through every folder in my Downloads folder and deleting its contents?
cd ~/Downloads;
rm -rf Archives;
rm -rf DMGs;
rm -rf Documents;
rm -rf Fonts;
rm -rf Mail\ Attachments;
rm -rf Mobile\ Provisioning;
rm -rf Music;
rm -rf Photoshop;
rm -rf Pictures;
rm -rf Videos;
mkdir Archives;
mkdir DMGs;
mkdir Documents;
mkdir Archives;
mkdir Fonts;
mkdir Mobile\ Provisioning;
mkdir Mail\ Attachments;
mkdir Music;
mkdir Photoshop;
mkdir Pictures;
mkdir Videos;
;is only needed if you have multiple commands in one line – yi_H Jul 29 '11 at 15:28