You may not know this, but your Mac keeps a log for just about everything that goes on inside of it. This means that restarts, errors, and memory faults are all tucked away nicely in a log file somewhere. This also means that every file you’ve downloaded on your Mac is kept in a log as well. This download history is a little trickier to get to than your normal system log file, but you can see it using Terminal and if you’re not too happy with its contents, clear it as well.
Follow the steps below to view your download history log, copy it, and clear it. As long as you’ve at least opened up Terminal before this should be pretty easy.
First things first, you need to open up Terminal. To get to it, go to Applications > Utilities > Terminal. You can also just open up Spotlight in the upper right corner of your screen and type Terminal into it to get there, too.
With Terminal open, paste the following command and hit Return:
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'select LSQuarantineDataURLString from LSQuarantineEvent'
You should get a pretty huge list of files listed in chronological order. Every time you download a file with Safari or an FTP application a new entry is created in a database on your Mac. The command above runs a query on this database, returning all of the downloaded files. Your windows should look something like this:
2. Copy and Paste
Now that you’ve seen your history, you can copy it to a file to make it a little more searchable and viewable. Click anywhere in the Terminal window and hit Command + A to select everything in the window. Next, click Command + C to copy everything. Open up a TextEdit window and hit Command + V to paste.
Now you have your entire download history saved in a text file. You can search it, view it, or just delete it. Having this on file can be really useful in case you need a file you’ve downloaded in the past but can only remember the website name.
3. Delete Your Download History
Once you’ve viewed and saved your download history, you might as well clear it. Clearing is good for making it more searchable later on, and great if you’d rather get rid of the traces of a few files you might not be so proud of downloading (it’s OK, we’re not judging you for liking Miley Cyrus.).
To delete your download history copy and paste this command into Terminal and hit Return:
sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV* 'delete from LSQuarantineEvent'
This command will clear out all entries in the LSQuarantineEvent database, which is where your download history lives. It should take 1-3 seconds depending on the size of your download history but when it’s done, everything is gone.
To test this, try running the original command again and you’ll get zero results.
It’s a good idea to clear this history before selling your Mac, or before returning it to your work or school to not only protect against judging eyes, but to protect your privacy. There can be bank files you’ve downloaded listed in this list as well as usernames to sites that have poorly formatted URLs.
It’s also a good idea to clear this download history before sending your Mac in for service. Most service techs are good, honest people but there are always some that would steal your data, so don’t give them the chance.
Thanks to iDownloadBlog for the original article.