Hidden Mac files on USB sticks, SD cards and zips: what they are and how to get rid of them

You put twenty songs on a USB stick for the car, and the radio suddenly finds forty. Or your Windows colleague asks what all those odd files starting with a dot and an underscore are. Those are traces your Mac leaves behind, and you never see them on another Mac. This whitepaper is part of the series “Mac and the rest of the world” and explains what these files are, why macOS creates them and how to prevent or clean them up.

Which files are we talking about?

macOS keeps extra information about files and folders that isn’t stored inside the file itself. Think Finder tags, icon positions in a window, where a download came from, or the Spotlight index. On a drive with Apple’s own file system (APFS) all of that travels along invisibly. On a stick or card formatted as FAT32 or exFAT, the format Windows, TVs and cameras understand, that isn’t possible. So macOS turns it into ordinary hidden files.

File or folder What it is Where you find it
._filename AppleDouble file holding the extended attributes (and in the old days the resource fork) of the file next to it FAT32/exFAT sticks and SD cards, sometimes network shares
.DS_Store Finder settings per folder: view, icon positions, Finder comments Any folder where you changed something in the Finder
.Spotlight-V100 Spotlight index for that drive, so you can search it Root of an external drive
.fseventsd Log of changes, used by Time Machine and Spotlight among others Root of an external drive
.Trashes That drive’s Trash. Whatever you delete stays here until you empty the Trash Root of an external drive
.TemporaryItems Temporary files from apps working on that drive Root of a drive or network share
__MACOSX Folder inside a zip holding the ._ files for everything in it Zips made with Compress in the Finder

Why it goes wrong outside the Mac

A Mac knows that ._song.mp3 belongs to song.mp3 and leaves it alone. A car radio just sees a file ending in .mp3 and tries to play it. The result is an error, a gap of silence or a doubled track list. A photo frame or TV shows blank or broken pictures. And anyone on Windows with hidden files switched on sees the whole collection.

Seeing hidden files on your Mac

In the Finder, press Cmd+Shift+. (period) to show or hide hidden files. That reveals folders like .Trashes and .Spotlight-V100. One catch: according to Howard Oakley of The Eclectic Light Company, .DS_Store and ._ files stay invisible even then, because they carry an extra invisible flag. To really see everything, use Terminal:

ls -la /Volumes/STICKNAME

Replace STICKNAME with your stick’s name. You can also drag the stick from the Finder into the Terminal window and the path fills itself in.

Solutions

dot_clean: clearing out the ._ files

macOS has its own command for this. This removes every ._ file on the stick:

dot_clean -m /Volumes/STICKNAME

Without -m, dot_clean first tries to merge the information back into the real file. FAT32 and exFAT can’t hold it, so on those -m is what you want. You remove .DS_Store with:

find /Volumes/STICKNAME -name .DS_Store -delete

Be careful with the path. This command deletes without asking.

No more .DS_Store on network shares and sticks

For network shares, Apple has an official support article (“Adjust SMB browsing behavior in macOS”) with this command:

defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool TRUE

Then log out and back in. Apple presents it mainly as a way to speed up browsing SMB shares. It only applies to your own user account and doesn’t clean up existing files.

There’s a sibling for USB:

defaults write com.apple.desktopservices DSDontWriteUSBStores -bool TRUE

To be straight with you: Apple doesn’t document this one. It has appeared in IT department guides for years, but I found no source confirming it still works in macOS Golden Gate. So test it yourself: switch it on, log in again, open a folder on the stick and check with ls -la whether a .DS_Store still appears. Undo it with defaults delete com.apple.desktopservices DSDontWriteUSBStores. Also note it only stops .DS_Store, not the ._ files.

Turning off Spotlight for a stick

If you don’t want .Spotlight-V100 on a stick, switch off indexing for that drive:

sudo mdutil -i off /Volumes/STICKNAME

You’ll be asked for your admin password. After that you can safely delete the existing folder. You can also add a drive to Spotlight’s privacy exclusions in System Settings. I couldn’t check exactly what that button is called in Golden Gate, so Terminal is the reliable route here.

Trash and .Trashes

Delete something on a stick and it sits in .Trashes, still taking up space. Empty the Trash before ejecting, or delete immediately with Cmd+Option+Backspace.

Zips without __MACOSX

The __MACOSX folder comes from the Finder’s Compress option. Make the zip in Terminal with the standard zip command and you won’t get it:

cd ~/Desktop
zip -r -X project.zip ProjectFolder -x "*.DS_Store"

-r includes subfolders, -X leaves out extra file attributes and -x "*.DS_Store" excludes the Finder files. Check the result with unzip -l project.zip. Prefer an app? Keka has a setting to exclude Mac resource forks. Other archive apps can do it too; look in their settings for anything about Mac files or resource forks.

Eject properly

Ejecting in the Finder (or dragging to the Trash in the Dock) doesn’t clean up these files. It does make sure everything has actually been written. Pull the stick out without ejecting and you can end up with half-written ._ clutter or a damaged FAT table. So always eject, just don’t expect it to tidy up.

Apps that do it for you

BlueHarvest from Zeroonetwenty is the best known. It automatically cleans .DS_Store and ._ files off external drives. According to Homebrew, 8.5.1 is the current version. I couldn’t confirm whether it officially supports macOS Golden Gate, as I wasn’t able to check the developer’s site. Have a look there before you buy. CleanEject is an older free tool that cleans up when you eject. I found no current source showing it is still maintained or runs on a modern Mac, so I wouldn’t recommend it without testing.

Is deleting them harmful?

Usually not. On a stick for the car, an SD card for the camera or a folder for a Windows user, they do nothing for you. Here’s what you lose:

If in doubt, for instance on a backup drive, leave them alone. They do your Mac no harm.

What to do in your situation

USB stick for a car radio or TV

Format the stick as FAT32 (or exFAT if the device supports it), copy your music or video, then run dot_clean -m and the find command for .DS_Store. Turn off Spotlight for the stick. Empty the Trash and eject. This is the case where the files really get in the way.

Sharing files with a Windows colleague

By stick: same approach, or BlueHarvest if you do it often. By network share: switch on DSDontWriteNetworkStores. By email or a cloud service: send a zip made in Terminal or with Keka.

SD card for a camera

Always format the card in the camera itself, not on the Mac. Import your photos with Photos or Image Capture and don’t write anything back to the card. That keeps it clean. If you did work on it in the Finder, reformat it in the camera.

Sending a zip

For a Mac user it doesn’t matter. If it’s going to someone on Windows, a web upload form or a client who checks everything, use zip -r -X with the .DS_Store exclusion.

Step by step

  1. Copy your files to the stick or card.
  2. Open Terminal and type sudo mdutil -i off followed by the path to the stick (dragging works).
  3. Type dot_clean -m /Volumes/STICKNAME to remove the ._ files.
  4. Type find /Volumes/STICKNAME -name .DS_Store -delete.
  5. Check with ls -la /Volumes/STICKNAME. Delete .Spotlight-V100 and .fseventsd by hand if you like.
  6. Empty the Trash and eject the stick in the Finder.
  7. If you do this often, check whether BlueHarvest supports your macOS version and let it run automatically.

And with Apple?

Between Macs there’s nothing to worry about. Another Mac understands the ._ files, hides them and even uses the information in them. Send something by AirDrop, iCloud Drive or Messages and the extra information travels along properly, with no loose files. The Files app on iPhone and iPad also hides files starting with a dot. So the problem only exists at the border with the rest of the world, and that’s exactly where you need to pay a bit of attention.

This whitepaper describes the situation in October 2026, with macOS Golden Gate (macOS 27), iOS 27 and Windows 11. I couldn’t confirm whether DSDontWriteUSBStores and BlueHarvest work on Golden Gate. Test it yourself before relying on it.

This article is part of the Mac and the rest of the world series, where you’ll find every part in one place.

One email. Every last Friday of the month.

The week in Apple, read in three minutes. No rumors, no affiliate filler.

Scroll to Top