Good Morning, Your Mac Keeps A Log Of All Your Downloads

The terminal is a pretty powerful tool in Mac OS X. Hardcore server nuts can fly through preferences and settings tweaks without ever touching a GUI. Then there are some things you can do in the Terminal that are just straight out important. This is likely one of the latter, though it does present a bit of a privacy issue. According to OS X Daily the Launch Services quarantine keeps a list of every file you’ve ever downloaded on your Mac, as that’s what triggers the warning dialog about opening files from the Internet. Oddly enough, even if you’ve disabled this in the command line, the database is still keeping track.

To see this in action, simply paste this code into your terminal:

sqlite3 ~/Library/Preferences/* 'select LSQuarantineDataURLString from LSQuarantineEvent'

You should get something that looks like the image at the beginning of this article. This will be a list of everything you’ve downloaded on your Mac, regardless of which program you used. The only exception to this is apps from the Mac App Store.

If you’re looking for specific file types you can sort them by adding “ | sort” at the end of the command. You can actually do a bit more with the database if you’re confident. (Seriously, don’t email us if you mess up your computer.) Since this obviously shows everything you’ve downloaded, it can be a privacy risk, especially if you are dealing with confidential information from your employer. So to scrub this file you need to simply enter this command:

sqlite3 ~/Library/Preferences/* 'delete from LSQuarantineEvent'

This clears out the file. Paste the first command a second time to verify that this works. This is pretty light as far as privacy risks go, but there are more than a few of you who’d like to clean this up. Create this script in Applescript Editor and run it as often as you’d like.

do shell script "sqlite3 ~/Library/Preferences/* 'delete from LSQuarantineEvent'"

You can also schedule the script to run using Automator and iCal. Please let us know in the comments if you’d like a tutorial on using Automator to schedule tasks on your Mac.

Mac geek? Gamer? Why not both? Mike is a writer from Wisconsin who enjoys wasting immense amounts of time on the Internet. You can follow him on Twitter.