macOS 的「系統設定」只露出一部分選項,更多行為藏在偏好設定資料庫。defaults write 就是直接改這個資料庫的工具。每條指令都可逆,但你要清楚自己在改什麼。
defaults write 網域 鍵名 -型別 值
例如把截圖預設改成 JPG(省空間):
defaults write com.apple.screencapture type jpg
killall SystemUIServer
取消 Dock 彈出的延遲與動畫,反應變即時:
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0
killall Dock
defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder
defaults write com.apple.screencapture name "iLab" # 截圖檔名前綴
defaults write com.apple.screencapture type png # png / jpg / pdf
killall SystemUIServer
讓 Finder 視窗標題顯示完整路徑,找檔更清楚:
defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
killall Finder
defaults write NSGlobalDomain NSWindowResizeTime -float 0.001
每個設定都能移除回到預設:
defaults delete com.apple.dock autohide-delay
defaults delete com.apple.finder AppleShowAllFiles
killall Dock; killall Finder