Why Do Macs Leave Garbage Files Like “ds_store” On My Flash Drive, And How Do I Stop It?

Justin Pot 23-05-2013

mac trash files“What’s all this crap?” she complains. You’ve just handed back her USB drive, now plugged into her PC.


What?” you ask.

“On my flash drive,” she says. “There are all of these…stupid files.”

Are you sick of explaining why your Mac – despite being superior in every way to her PC – feels the need to leave behind a bunch of files on her USB key? Or network drive, for that matter? Stop it from happening.

Indexing, trash bins, folder positions – OS X keeps track of all these things, on every drive connected to your Mac, by creating files. These files are fine on a Mac – OS X uses them regularly, and hides them from the user. Plug a drive mainly used with Windows into a Mac, however, and in Windows you’ll see a variety of useless files cluttering things up. Do you want to stop the madness? You can.

The Problem

Feel unclear what the problem is? Insert any flash drive readable by Windows – FAT, in all likelihood – into your Mac. Eject it, then insert it into a Windows computer. You’ll be greeted by this nonsense:


mac trash files

What’s all that crap? Well, the Spotlight and Trash folders should be obvious – they’re related to indexing and deleted files, respectively. The folder “.fsevents” records file system events. It’s a record of everything that happens on the drive. And the infamous “DS_store” file – not pictured above – records things like the placement of icons in Finder.

This is all useful to Macs, but in Windows it’s just annoying. Why does OS X write such files to drives formatted FAT, knowing Windows users will see it as nonsense? Good question.

Your Mac creates these files basically the second you plug in a drive, so there are two things you can do – delete the files before you eject the drive or stop the Mac from creating the files. I’m going to outline some apps, starting with two that take the first approach before moving on to two that take the second.


Automatically Delete the Files Before You Eject

If you think you can remember to use them, two different application can delete all of these files when you eject. Simply add the app icon to your dock and you’re ready to use it.

The first such app is Eject For Windows, which despite its name is actually a Mac program. Drag any drive you want to eject here and all of the crap files will be deleted:

junk files on mac

Another app, called HiddenCleaner, works the same way:


junk files on mac

I tested both of these apps using Mountain Lion and Windows 7 – the Mac left no ugly files that the PC could see. Because both apps work the same way, you can pretty much choose based entirely on which icon you like best. I’ve got to say, Hidden Cleaner wins for me on that front (it’s up to you, though).

Stop The Files From Being Created

Want to stop these nonsense files from even appearing on non-Mac drives? Install BlueHarvest. This app installs as a preference pane, allowing you to configure when such files are created:

junk files on mac


There’s a 30-day trial, but if you want to keep this app around you’re going to need to pony up $15. If crap files on Windows drives is something you really, really care about, check out BlueHarvest.

Mostly concerned about .DS_Store files on network drives? TinkerTool, a free configuration tool, can handle that. The first screen of this app allows you to stop your Mac from leaving crap files on network drives:

mac trash files

Check that box and your Mac will stop creating such files. This program does a lot more, so read more about Tinkertool Tweak Program Settings & Activate Hidden Features With Tinkertool [Mac] Read More . It’s not as complete as BlueHarvest – no support for USB drives – but combined with a tool like Hidden Cleaner you’ll be completely set.


Getting a file from a PC to a Mac used to be a big deal – file incompatibilities were a fact of life. These days the two platforms play more-or-less nicely with each other – yet annoyances like this persist. I think OS X should be smart enough to tell when a drive is meant to be shared with Windows computers and adjust accordingly, but I want to know what you think.

Is this not nearly as big a deal as I’m making it out to be? Or do you also think something at the system level should be done to fix this? Let us know in the comments below, along with links to any other tools for solving the problem.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. AncientWisdom
    June 24, 2018 at 2:26 pm

    Looks like the download link to Eject for Windows is no longer working.

    I couldn't get Hidden Cleaner to open on OSX El Capitan (10.11) - it said the file was damaged.

    Trying to BlueHarvest now.

    By the way, my use case is different to just flash drives - I run Boot Camp with a drive being shared between the macOS and the Windows partitions.

  2. Glen
    December 21, 2017 at 3:33 am

    Thanks for this article.
    I bumped into it while trying to solve an issue with my favourite USB drive "loosing" some files and an important folder after being plugged in to a Macbook Pro and a couple of files copied onto it.
    I use my USB drive regularly between Windows 7 and Ubuntu 14.04 machines without issue. But after plugging it into a friend's Macbook to grab some PDF files, the copied files and the "Personal" folder (which had apparently been "touched" by OSX) had completely "disappeared" when plugged back into my Ubuntu Linux machine (yet were visible if I conducted a Search).
    Turning on "View, Show Hidden Files" relieved my concerns that files and folders might have somehow been deleted - the missing files and important Personal folder now appeared in Ubuntu FileManager, along with all the Mac junk files and folders mentioned in the article.
    I deleted all 3 of the Mac junk .Folders, and 4 Mac junk ._.Filename "Lock files".
    Now my "missing" folder and files appear normally again, without having to turn on "Show hidden files".
    I find it rather strange that the junk folders and/or the lock files had the effect of "hiding" my files and folder from normal view in Linux when the files did not have the hidden flag set.
    Hope this helps someone else too!

  3. Leo Shafai
    December 8, 2017 at 6:40 pm

    this is stupid, it just stores organization info. Just make them get set to hidden when on a pc

    they are only a few bytes

    you're wasting your time "cleaning" these, then messing up the location of where you had anything so you can get to them easier

    windows has the same type of thing, just nobody knows to to adjust viewing settings

    • Leo Shafai
      December 8, 2017 at 6:42 pm

      this is nothing about either OS or anything to do with your computer, its just about knowing how to use it

    • Tony Stewart
      June 30, 2019 at 10:47 pm

      Its a problem with using android OTG as well.

  4. Peekofwar
    February 16, 2017 at 7:16 pm

    Seriously though... A hidden "Trashes" folder holds a few megabytes of storage... That's a waste! Just think about it: It's not really deleting the files, it's just tossing them to a hidden folder so that you THINK they're deleted. I think it'd be more efficient to not use the device for these types of operations.

    • Peekofwar
      February 16, 2017 at 7:59 pm

      The computer should instead use a temporary cache folder in the main computer hard disk, not in the removable storage device. That way we don't run out of space on the device due to files that were "moved to trash", or files that are simply for some silly desktop-esk icon setup.

  5. Peekofwar
    February 16, 2017 at 7:12 pm

    If I use "Hidden Cleaner", does it only delete the files that the MAC computer creates, or does it delete all hidden files? I'd be slightly worried using that if that is the case 'cause I may have my own hidden files on the device.

  6. Samantha
    November 30, 2016 at 5:54 pm

    "Despite being superior in every way..." You're kidding right? The Mac doesn't by default read most exe files. Even when it does, it doesn't correctly know the difference between an app style exe (one that runs from the exe) and an installer exe. The desktop interface is garbage, I've tried to shortcut stuff (the link to one of my drives) only to have the file actually MOVED, and you can't move it back without alot of effort. It doesn't appear to come with a decent built-in Paint program. The stupid mouse has to be special customized to right click.
    Oh, and it leaves the aforementioned junk behind.

    • Larz0
      September 30, 2017 at 9:01 pm

      A travesty!

    • Sean
      May 29, 2018 at 3:17 pm

      Oh, and don't forget to eject the disk before you unplug it... I know you are "supposed" to on Windows, but frankly, I've never had an issue with it.. Not once. First time using MacOSX however, I quickly made the mistake of just unplugging it, and it corrupted the entire drive and I lost all my files because I had to reformat the drive. That's a MASSIVE fail.

  7. John
    November 24, 2016 at 12:28 am

    Hidden Cleaner saved my ass. I use usb drives, often filled with music files which I plug into my AVR receiver. When they show up on the receiver I have to scroll down through so many "._" files it makes me not want to listen at all! Same thing when I load video files onto a drive and plug it into a tv. I thought I was saddled with this annoyance forever. No more! Thank you very much!

  8. Cianno
    September 19, 2016 at 2:00 pm

    She must have a very poor PC.

    • Weaselspleen
      September 20, 2016 at 5:50 pm

      The quality of one's computer has nothing whatsoever to do with Mac OS generating garbage files.

  9. Juan-Carlos Gonzalez de Savage
    June 10, 2016 at 8:42 am

    Thanks for the article. I have a small business and my latest employee is a mac user. I've never had a problem with all the temp files, but some of my staff find them confusing. This has been a great help.

  10. Anonymous
    June 27, 2015 at 12:19 am

    Hi guys!!
    I brought my usb/ mp3 to an internet cafe to get something printed and when I came back all my files had been moved to this folder .Trashes

    What's more, every time I try to move my stuff OUT of this folder, SOMETHING moves it all back into it!

    I don't understand anything about computers but it seems that none of the programs above are for Windows (I'm using Windows 8). I even tried formatting the thing but .Trashes is still there...

    Would anybody have a suggestion on how to clear this on a Windows platform, please?

  11. PC's the best
    March 25, 2015 at 12:58 am

    In no way is mac superior to PC!

    • No, its not, but better than mac
      April 15, 2015 at 8:39 pm

      And in no way is Windows superior to Linux!

    • Justin Pot
      April 16, 2015 at 2:42 am

      I prefer Amiga, really.

  12. Zac
    February 23, 2015 at 6:46 am

    I don't see why Macs can't just save this stuff to the computer itself and then they wouldn't have to write it to the USB. It does make sense for trash though, unless they just change it to delete entirely like Windows does on removable drives.

    • Justin Pot
      February 23, 2015 at 5:43 pm

      The idea, if I had to guess, is that this date be persistent from one Mac to the other. But I agree: ideally these files shouldn't show up on FAT drives.

  13. John.s
    February 18, 2015 at 8:28 am

    The 'superior' mac, leaving files on private network shares of my customers ... nice one.
    Man, mac is great, for what is is. An OS for people like content creators,home users, people that do email,web,chat video and stuff.... but for people wanting to do other things it is a junk.

    - Try testing WiFi's and use a usb wifi card capable o packet injection
    - Try connecting over serial to a Cisco router/Other appliance
    - Try desktop sharing remote,secure, from a windows/linux to a mac
    - Try installing a linux distro on a macbook for on-demand needs.
    - Try using the 'activity monitor' to tel in 5sec what is slowing you down or something
    - Try deleting temp/disk cache fast in case of an emergency - bad ppl. entering to get confidential data
    - Try using tools needed by sys/network admins ...

    - Try asking how you do something more advance on the apple forum, and the first "answer" is "-but why do you want to do that, it just works! :)

    • Justin Pot
      February 18, 2015 at 4:59 pm

      I've done a few of these with my Macbook, but it's true: Macs aren't perfect for everyone. You won't get any arguments from me.

  14. Happy PC user
    November 15, 2013 at 12:53 pm

    "... your Mac – despite being superior in every way to her PC ..."

    ROTFL, some kind of ego issues? Oh wait... why it's always a Mac user who tries to convince everybody around that the Mac doesn't suck (that bad)? But the numbers don't lie, the so called "superior" Mac is faaaaaaaaar behind Windows userbase. Simple as that.

    • Justin P
      November 15, 2013 at 3:39 pm

      I'm glad you laughed, because that was meant to be a joke.

  15. macwitty
    May 24, 2013 at 5:59 pm

    For me it is not as big a deal as it is made here. Saying that I do want something at the system level to fix it.

    I have not used it, but do not Cleam ny Drive - free in Appstore do the jobb? and

  16. Bruno Casarini
    May 24, 2013 at 11:53 am

    There's also the beautiful CleanMyDrive to do this kind of job:

    • macwitty
      May 24, 2013 at 6:01 pm

      Sorry Bruno, didn't see you post before I posted mine with the same content

    • justinpot
      May 24, 2013 at 6:11 pm

      This is excellent. I love it when you guys find stuff I didn't.

  17. Taurac
    May 24, 2013 at 5:29 am

    Stopped reading at, "despite being superior in every way to her PC".

    • justinpot
      May 24, 2013 at 1:55 pm

      It was meant as a joke about Mac users, but enough Mac users actually think that way that I can see why you took it seriously.

    • Rolling eyes
      February 13, 2015 at 7:08 am

      Yeah, no kidding. So over this mentality.

  18. Donovan
    May 24, 2013 at 5:05 am

    Is there a way to make it so it doesn't pack the extra junk files in the zips it makes?

    • justinpot
      May 24, 2013 at 1:55 pm

      Use a different program to make the zips, I think.

  19. Jerry
    May 24, 2013 at 1:04 am

    After looking at their websites, and some Mac forum threads, I will pass on HiddenCleaner.

  20. Jerry
    May 23, 2013 at 11:18 pm

    Thanks- I've looked into this before, and neither of the free flashdrive utilities sounds familiar: Are there any other Free alternatives? I seem to remember one that Prevents this trash, and is Free ~

    • justinpot
      May 23, 2013 at 11:37 pm

      If it exists I haven't found it. And I looked quite a while, but as always: I'd be thrilled to be wrong.

  21. Chris
    May 23, 2013 at 9:01 pm

    What I learned from this is that my long, hard, thick Mac is superior to my stupid girlfriend's PC in every way!

  22. Doc
    May 23, 2013 at 8:09 pm

    "Insert any flash drive readable by Windows – FAT, in all likelihood"

    FAT32, in all likelihood; FAT12 is only used on floppy drives, and FAT16 can only be used for partitions of 2GB or less. Microsoft released ExFAT for drives larger than 32GB (Windows XP and up will refuse to format a partition of larger than 32GB as FAT32, which is stupid; tools like Partition Magic, etc. will do so with no problems, however.)

    • justinpot
      May 23, 2013 at 9:27 pm

      You're absolutely correct, I just wanted to be less specific. Many people use ExFAT now.

      • Doc
        May 25, 2013 at 5:33 am

        Who uses ExFat? Even the 32GB thumbdrive I bought a year ago was formatted FAT32; the new 8GB I bought two weeks ago was formatted FAT32 (I know this because I still have an XP machine that doesn't have ExFAT support installed, and both drives are recognized).

        • Justin Pot
          May 25, 2013 at 7:46 pm

          ExFat is increasingly used by Mac users, because it offers cross-platform compatibility without some of the limitations of FAT32. But you're right: most devices come with FAT32.

        • Doc
          May 27, 2013 at 6:03 am

          What "limitations"? IIRC, the only limitations on FAT32 that mean anything are a file size limit of 4GB, and the fact that Microsoft's patent on FAT32 has expired (the real reason they created ExFAT).

        • Justin Pot
          May 27, 2013 at 2:08 pm

          The 4GB thing is a huge deal if you're working with media, which is true of many Mac users.

          Also, from my understanding, ExFat doesn't have the filename restrictions FAT32 does, which can be important for some projects. InDesign users, for example, depend on linked images – and will curse a lot if filenames shorten There's also a difference in terms of how large a partition you can create, though the current limit (8 TB) isn't going to affect many people.

          But I'm willing to admit if I'm wrong about anything, I've just noticed in my IT work and reading around the web that ExFat is becoming common among those who need to move files from Windows to Mac and back. Shame about Linux compatibility, though...

    • Peekofwar
      February 17, 2017 at 6:23 pm

      What about NTFS? Can a MAC computer read those?