Blog Post

Quick Tip: Search the Trash in OS X

At the moment I’ve got 1,303 items in the trash bin in my OS X Dock (s aapl) — not that much compared to the usual pile that accumulates there when my normal maintenance has me only cleaning it out once every couple of months. Usually, it’s not a problem. Occasionally, though, I’ll throw something away by mistake, at which point I’m reminded that you can’t just click on the bin and search through the trash like you can with other folders in your Dock.

It may sound like a small annoyance, but if I’m digging through the trash, it’s because I really need to find that thing I tossed out. Without a chance to search for it I’m left with no other option but to browse through a pile of files that typically number in the thousands. All this turns a small annoyance into a rather large one. There’s got to be a better way to deal with all this Trash.

Ordinarily when searching for files in the Finder you can choose to limit the scope of your search to the current folder by selecting it from the search bar. This is a big help when you know the file you want is somewhere in this folder, but you’re not entirely sure what its name is.

But trying this approach after clicking on the trash icon leaves you searching the entire system with no way to limit your scope. I suppose I could just do a better job regularly taking out the trash — this would leave me with fewer files to browse through when the time comes — but I know myself and that’s just not going to happen. Another option would be to write a script to handle trash maintenance, but that might just make a bad problem worse if my script gets rid of something I accidentally threw away before I have a chance to retrieve it.

The best solution, it seems, is also the easiest one. I use “Go To Folder” in the finder to navigate to the otherwise hidden trash directory at ~/.Trash and drag that folder into the Dock. Now when I accidentally throw something away I won’t have to browse through thousands of items looking for the lone needle in the haystack. I can just use .Trash to limit my search scope as I would with any other directory in the system.

View screencast of how to do this.

11 Responses to “Quick Tip: Search the Trash in OS X”

  1. drtyfngr

    Thanks for the trick AND thorough instructions, always baffled me why the search function didn’t look in there too. I’ve been having lot’s of problems with what look like duplicate mp3’s in iTunes, I end up trashing them and finding I’m left with just just an m3u (i think thats the file name) that links to my trash. This will help.

  2. Thankyou for providing this information, I found it useful and clever.
    I used the undo feature of Finder, but your technique address’s the issue of searching the trash quickly.

  3. If you’re using Time Machine, there’s no reason to keep this pile of junk in your trash, where it can start to smell and attract rodents. Time Machine lets you search and find anything back as far as you’d like to keep it. With multi-terabyte drives now easily affordable, there’s no reason to keep something on your active drive longer than necessary.

  4. Maku Nie

    Is there a program for OSX that can look for deleted files after they have been emptied out from the trash can? Freeware preferably.

    I’ve come across two of them, but they are not good at all, since there is no way of searching for a file by name.

  5. I must agree with A. Moore that I used to delete everything in trash very shortly. Then I got a 250G hard drive instead of my old 80G and I became really lazy.
    This can happen.

    Neat trick anyway.

  6. Interesting. I don’t keep anything in the Trash for more than a few seconds. Command-Delete is immediately followed by Command-Shift-Delete, much like “A-” is immediately followed by “-choo.”

    Neat trick, anyway. Thanks.