Why does a .DS_Store file keep appearing on the desktop? Every time I delete it from the desktop, I get the same file ".DS_store" created after some time. Is there a reason why this happens ? And can I permanently stop it from being created ?
Type this in Terminal (/Applications/Utilities/Terminal.app):

defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder


The first command sets the hidden files visibility to hidden; the second one forces Finder to restart. This is needed for the first command to take effect. 

You can also log out/reboot instead of killing the Finder, but the first command is needed to change a hidden preference (one that the Finder can’t change using the normal Finder view options or preferences).