Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a way to delete all files of the Downloads folder with a shell script or applescript that is run on a daily/weekly basis and most importantly backs up all of the file details, except the data itself.

Deleting the files, and scheduling the script is not a problem, I could even do it with automator. The only part I really don't know how to do is the backing up of file details. I would like to backup the list of files with their details. Ideally it would be something like creating an alias for every file. To save a sort of browsable back-up without the data, just the file details.

share|improve this question

migrated from May 22 '12 at 13:00

This question came from our site for professional and enthusiast programmers.

up vote 0 down vote accepted

In a script:

cd ~/Downloads
ls - l * >> ~\backup.txt
rm -rf *`
share|improve this answer

For deleting the contents of a file you could use:

sudo echo "" > filename.ext

Hopefully will this help you enough to continue.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.