让访达始终显示文件扩展名
修改一个全局偏好,所有访达窗口都会显示 .pdf、.docx、.jpg 等扩展名,“发票”和“发票.pdf”一眼可辨。
运行 `defaults write NSGlobalDomain AppleShowAllExtensions -bool true && killall Finder`;恢复隐藏把 true 改为 false。
01命令
命令
$ defaults write NSGlobalDomain AppleShowAllExtensions -bool true && killall Finder02作用说明
macOS 默认隐藏扩展名,这就是为什么两个都叫“报告”的文件看起来一样,直到你发现一个是 report.pages 另一个是 report.docx。AppleShowAllExtensions 存放在 NSGlobalDomain(所有应用共享的全局域)中,写入一次对所有窗口和新文件生效。因为 Finder 启动时会缓存偏好值,所以需要 killall Finder 重启它——窗口会闪一下然后恢复。单个文件上“隐藏扩展名”的勾选仍然优先于全局设置。
03风险
04撤销
撤销
$ defaults write NSGlobalDomain AppleShowAllExtensions -bool false && killall Finder05来源
- defaults — read and write user defaults (macOS man page)依据: Documents defaults write with a domain and key, and NSGlobalDomain as the global preference domain.
最后验证: 2026-09-18 · 分类: 系统与设置