Mac

发布于 更新于

AI总结: 本文介绍了多项macOS系统的终端命令,用于优化用户体验,包括设置程序坞的显示与隐藏时间、禁止生成.DS_Store文件、简化窗口拖动、显示文件扩展名和隐藏文件、显示路径栏、确保文件夹优先显示、处理.dmg文件损坏提示以及更改截图保存位置。 优化建议:可以将命令分类整理,增加每个命令的简要说明,便于用户理解其功能和用途。同时,考虑提供恢复默认设置的命令,以便用户在需要时可以快速恢复系统原状。
  1. 设置程序坞显示与隐藏时间, 设置为 0 无延迟显示隐藏。
defaults write com.apple.dock autohide-delay -float 0
defaults write com.apple.dock autohide-time-modifier -float 0.5
killall Dock
  1. 防止 macOS 的 Finder 在网络设备或者 USB 设备上生成 .DS_Store 文件
defaults write com.apple.desktopservices DSDontWriteNetworkStores true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
  1. 不需要拖动标题栏,只要按住 Ctrl + Command 之后,在窗口任意位置就可以拖动窗口:
defaults write -g NSWindowShouldDragOnGesture -bool true
  1. 访达显示文件扩展名
defaults write NSGlobalDomain "AppleShowAllExtensions" -bool "true" && killall Finder
  1. 访达显示隐藏文件
defaults write com.apple.finder "AppleShowAllFiles" -bool "true" && killall Finder
  1. 访达显示路径栏
defaults write com.apple.finder "ShowPathbar" -bool "true" && killall Finder
  1. 访达将文件夹放于最前方显示
defaults write com.apple.finder "_FXSortFoldersFirst" -bool "true" && killall Finder
  1. dmg安装提示文件损坏
xattr -cr /Applications/demo.app
  1. 更改截图保存位置
defaults write com.apple.screencapture type jpg
mkdir ~/Pictures/Screenshots
defaults write com.apple.screencapture location -string "~/Pictures/Screenshots"; killall SystemUIServer

相关链接

  1. macOS defaults list