os x 下面禁止并删除.DS_Store文件
Contents
[NOTE] Updated April 13, 2015. This article may have outdated content or subject matter.
查看.DS_Store文件结构
先来看看怎么样解析.DS_Store文件,代码来自: https://github.com/ff0000team/Beebeeto-framework/blob/master/utils/tools/ds_store_viewer.py
|
|
运行上面的代码的结果如下:
[email protected]:~/code/code-python|⇒ python ds_store_view.py ~/.DS_Store
[*] .oh-my-zsh
[*] hacker
[*] code
[*] .python-eggs
[*] Movies
[*] .zshrc
[*] .zsh-update
[*] Desktop
[*] Music
[*] .profile
[*] .fontconfig
[*] .zshrc-e
[*] .geeknote
[*] .subversion
[*] .489454.padl
[*] .zenmap-etc
[*] .Xauthority
[*] .vimrc
[*] Downloads
[*] .config
[*] .cheat
[*] .cache
[*] .
[*] .matplotlib
[*] .rvm
[*] .DS_Store
[*] .sqlmap
[*] .wireshark-etc
[*] .mkshrc
[*] .Trash
[*] .pip
[*] Public
[*] .bash_profile
[*] Documents
[*] .zprofile
[*] .bash_history
[*] Applications
[*] .viminfo
[*] Library
[*] Pictures
[*] .vim
删除.DS_Store
直接在终端下输入下面命令
find / -name ".DS_Store" -delete
禁止.DS_Store文件生成
在终端下面输入下面命令,就可以了,注意一定要sudo权限才可以的,改好后要注销用户或者重启系统。
禁止.DS_store生成:
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
恢复.DS_store生成:
defaults delete com.apple.desktopservices DSDontWriteNetworkStores
参考
Author beyondkmp
LastMod 2015-04-13