I'm developing sites on mac and every time I create some folder (or file in that folder) .DS_Store is created in that folder.
How to prevent creating .DS_Store file ?
I'm developing sites on mac and every time I create some folder (or file in that folder) .DS_Store is created in that folder.
How to prevent creating .DS_Store file ?
Please install http://asepsis.binaryage.com/ and then reboot your mac.
ASEPSIS redirect all .DS_Store on your mac to /usr/local/.dscage
After that, You could recursively delete all .DS_Store from your Mac.
find ~ -name ".DS_Store" -delete
or
find <your path> -name ".DS_Store" -delete
You should repeat procedure after each major Mac update.
NOTE: "Asepsis is no longer under active development and supported under OS X 10.11 (El Capitan) and later."
Here's a comprehensive review of your options. Asepsis (the second solution mentioned) seems to be what you're looking for, it re-routes .DS_Store creation to a unified cache instead of being located on every folder.
Its is possible by using mach_inject. Take a look at Death to .DS_Store
I found that overriding HFSPlusPropertyStore::FlushChanges() with a function that simply did nothing, successfully prevented the creation of .DS_Store files on both Snow Leopard and Lion.
NOTE: On 10.11 you can not inject code into system apps.
Open Terminal. Execute this command:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
Either restart the computer or log out and back in to the user account.
for more informations:
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
is the same for USB drives.
Put following line into your ".profile" file.
Open .profile file and copy this line
find ~/ -name '.DS_Store' -delete
When you open terminal window it will automatically delete your .DS_Store file for you.
alias nomore='find ./ -iname .DS_Store -delete'
Commented
Nov 5, 2014 at 21:20
this file starts to appear when you choose the system shows you the hidden files: $defaults write com.apple.finder AppleShowAllFiles TRUE If you run this command disapear $defaults write com.apple.finder AppleShowAllFiles FALSE Use terminal
the function
find ~/ -name '.DS_Store' -delete
, removed the .DS store files temporarily. But am not sure , whether the files will came back on the Mac. Also i noticed something peculiar, the "DS_Store" start coming to the Mac after installing 'ATOM'. So guys please make it sure to scan properly your third party software before installing them. Best
ATOM
is not creating the files. The Finder
application creates them when visiting a folder to store icon positions, selected view for the folder, background image, etc. DS_Store
, DS is Desktop Services.
Commented
Aug 13, 2016 at 19:25
If you want the .DS_Store
files to become invisible (they still exist but can't be seen) then run the following command in the "Terminal" window:
defaults write com.apple.finder AppleShowAllFiles FALSE; killall Finder
This will set the system default to stop showing these files on your Desktop and elsewhere. It will also restart the Finder in order to make this change visible (especially on your Desktop).