How can I permanently delete hidden files/folders on Mac USB drive?
7,371
To prevent /.Spotlight files you must prevent Spotlight fron indexing external drives.
To do this for a specific drive add a file called .metadata_never_index to the root directory of the removable drive.
You can also completely prevent spotlight indexing but I figured that was not what you were looking for.
To prevent .DS_Store files from being created:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
More Info Here (And More files that you can prevent) and Here
Related videos on Youtube
Author by
gadgetmo
Updated on September 18, 2022Comments
-
gadgetmo almost 2 years
I am aware that you can delete Mac OS X hidden files/folders (such as
/.Spotlight-V100
or.DS_Store
) on a USB drive using various scripts. But then the hidden files/folders get added again before you eject it.Is there any way to prevent this, and if so - how?
-
gadgetmo about 12 years@OliverSalzburg the ones that OS X adds automatically. westwind.com/reference/OS-X/invisibles.html. all of them.
-
Oliver Salzburg about 12 yearsIt might be helpful if you put the names of the hidden files in your question. That way people will quickly know what you mean.
-
HikeMike about 12 yearspossible duplicate of How to prevent Mac OS X creating .DS_Store files on non Mac (HFS) Volumes?
-
Jeremy W about 12 years
-
kenorb about 9 years
-