macOS defaults 命令演示列表
摘要
一份精选的 macOS `defaults` 命令列表,包含交互式演示,使用户能够通过命令行自定义系统和应用程序偏好设置。
<p><a href="https://lobste.rs/s/n54ybt/list_macos_defaults_commands_with_demos">评论</a></p>
查看缓存全文
缓存时间: 2026/09/12 00:31
# macOS 默认命令列表与演示 ✨
来源:https://macos-defaults.com/
macOS `defaults` 命令的不完整列表及演示 ✨
## 🙋 什么是 `defaults` 命令?(https://macos-defaults.com/#%F0%9F%99%8B-what-s-a-defaults-command)
*macOS 应用程序和其他程序* 使用 `defaults` 系统来记录用户偏好设置和其他信息,以便在应用程序未运行时进行维护(例如新文档的字体或信息面板的位置)。这些信息大部分可通过应用程序的“偏好设置”面板访问,但有时它们是隐藏的。
用户默认值属于**域**,这些域通常对应于单个应用程序。应用程序、系统服务和其他程序都有自己的域,它们还共享一个名为 **NSGlobalDomain** 的域。如果某个默认值未在应用程序的域中指定,则可能在 NSGlobalDomain 中指定。
每个域都有一个键和值的字典来表示其默认值;例如 **"Default Font" = "Helvetica"**。**键**是字符串,**值**可以是包含数组、字典、字符串和二进制数据的复杂数据结构。它们以 XML 属性列表的形式存储。
`defaults` 命令行界面是一种与这些值交互的方式。
**来源:Real-World-Systems (http://www.real-world-systems.com/docs/defaults.1.html)**
### 命令行界面基础 (https://macos-defaults.com/#command-line-interface-basics)
#### 打印帮助信息
#### 列出所有域
#### 列出所有包含 *word* 的条目
bash
```
defaults find ${word}
```
#### 显示给定 *domain* 和 *key* 的类型
bash
```
defaults read-type ${domain} ${key}
```
#### 将 *old_key* 重命名为 *new_key*
bash
```
defaults rename ${domain} ${old_key} ${new_key}
```
## 💻 命令列表 (https://macos-defaults.com/#%F0%9F%92%BB-list-of-commands)
### Dock
- 位置 (https://macos-defaults.com/dock/orientation.html)
- 图标大小 (https://macos-defaults.com/dock/tilesize.html)
- 自动隐藏 (https://macos-defaults.com/dock/autohide.html)
- 自动隐藏动画时间 (https://macos-defaults.com/dock/autohide-time-modifier.html)
- 自动隐藏延迟 (https://macos-defaults.com/dock/autohide-delay.html)
- 显示最近使用的应用 (https://macos-defaults.com/dock/show-recents.html)
- 最小化动画效果 (https://macos-defaults.com/dock/mineffect.html)
- 仅显示活动应用程序 (https://macos-defaults.com/dock/static-only.html)
- 滚动至调度中心应用 (https://macos-defaults.com/dock/scroll-to-open.html)
### 屏幕截图
- 禁用阴影 (https://macos-defaults.com/screenshots/disable-shadow.html)
- 包含日期 (https://macos-defaults.com/screenshots/include-date.html)
- 位置 (https://macos-defaults.com/screenshots/location.html)
- 显示缩略图 (https://macos-defaults.com/screenshots/show-thumbnail.html)
- 选择截图格式 (https://macos-defaults.com/screenshots/type.html)
### Safari
- 显示完整 URL (https://macos-defaults.com/safari/showfullurlinsmartsearchfield.html)
### Finder
- 退出 (https://macos-defaults.com/finder/quitmenuitem.html)
- 显示扩展名 (https://macos-defaults.com/finder/appleshowallextensions.html)
- 显示隐藏文件 (https://macos-defaults.com/finder/appleshowallfiles.html)
- 路径栏 (https://macos-defaults.com/finder/showpathbar.html)
- 默认视图样式 (https://macos-defaults.com/finder/fxpreferredviewstyle.html)
- 文件夹置于顶部 (https://macos-defaults.com/finder/_fxsortfoldersfirst.html)
- 打开文件夹的目标位置 (https://macos-defaults.com/finder/finderspawntab.html)
- 默认搜索范围 (https://macos-defaults.com/finder/fxdefaultsearchscope.html)
- 30天后清空废纸篓项目 (https://macos-defaults.com/finder/fxremoveoldtrashitems.html)
- 更改文件扩展名警告 (https://macos-defaults.com/finder/fxenableextensionchangewarning.html)
- 保存到磁盘的位置 (https://macos-defaults.com/finder/nsdocumentsavenewdocumentstocloud.html)
- 标题栏图标 (https://macos-defaults.com/finder/showwindowtitlebaricons.html)
- 工具栏标题悬停延迟 (https://macos-defaults.com/finder/nstoolbartitleviewrolloverdelay.html)
- 侧边栏图标大小 (https://macos-defaults.com/finder/nstableviewdefaultsizemode.html)
- 列自动调整大小 (https://macos-defaults.com/finder/_fxenablecolumnautosizing.html)
- 状态栏 (https://macos-defaults.com/finder/showstatusbar.html)
### 桌面
- 文件夹置于顶部 (https://macos-defaults.com/desktop/_fxsortfoldersfirstondesktop.html)
- 所有图标 (https://macos-defaults.com/desktop/createdesktop.html)
- 磁盘 (https://macos-defaults.com/desktop/showharddrivesondesktop.html)
- 外置磁盘 (https://macos-defaults.com/desktop/showexternalharddrivesondesktop.html)
- 可移动媒体 (https://macos-defaults.com/desktop/showremovablemediaondesktop.html)
- 已连接的服务器 (https://macos-defaults.com/desktop/showmountedserversondesktop.html)
### 菜单栏
- 闪烁时钟时间分隔符 (https://macos-defaults.com/menubar/flashdateseparators.html)
- 数字时钟格式 (https://macos-defaults.com/menubar/dateformat.html)
### 鼠标
- 加速 (https://macos-defaults.com/mouse/linear.html)
- 速度 (https://macos-defaults.com/mouse/scaling.html)
- 焦点跟随鼠标 (https://macos-defaults.com/mouse/focusfollowsmouse.html)
### 触控板
- 点击力度(阈值) (https://macos-defaults.com/trackpad/firstclickthreshold.html)
- 使用拖移锁定进行拖移 (https://macos-defaults.com/trackpad/draglock.html)
- 不使用拖移锁定进行拖移 (https://macos-defaults.com/trackpad/dragging.html)
- 三指拖移 (https://macos-defaults.com/trackpad/trackpadthreefingerdrag.html)
### 键盘
- 长按按键行为 (https://macos-defaults.com/keyboard/applepressandholdenabled.html)
- Fn/🌐 键用法 (https://macos-defaults.com/keyboard/applefnusagetype.html)
- 功能键行为 (https://macos-defaults.com/keyboard/applekeyboardfnstate.html)
- 键盘导航 (https://macos-defaults.com/keyboard/applekeyboarduimode.html)
- 双击空格键添加句号 (https://macos-defaults.com/keyboard/applekeyboardaddperiodwithdoublespace.html)
- 切换语言指示器 (https://macos-defaults.com/keyboard/toggle-language-indicator.html)
### 调度中心
- 自动重新排列空间 (https://macos-defaults.com/mission-control/mru-spaces.html)
- 按应用程序分组窗口 (https://macos-defaults.com/mission-control/expose-group-apps.html)
- 切换到有打开窗口的空间 (https://macos-defaults.com/mission-control/applespacesswitchonactivate.html)
- 显示器拥有独立的空间 (https://macos-defaults.com/mission-control/spans-displays.html)
### 反馈助理
- 自动收集 (https://macos-defaults.com/feedback-assistant/autogather.html)
### Xcode
- 添加其他对应后缀 (https://macos-defaults.com/xcode/ideadditionalcounterpartsuffixes.html)
- 显示构建持续时间 (https://macos-defaults.com/xcode/showbuildoperationduration.html)
### 模拟器
- 截图保存位置 (https://macos-defaults.com/simulator/screenshotsavelocation.html)
### 文本编辑
- 默认文稿格式 (https://macos-defaults.com/textedit/richtext.html)
- 智能引号 (https://macos-defaults.com/textedit/smartquotes.html)
### 时间机器
- 不为 Time Machine 备份提供新磁盘 (https://macos-defaults.com/timemachine/donotoffernewdisksforbackup.html)
### 活动监视器
- 更新频率 (https://macos-defaults.com/activity-monitor/updateperiod.html)
- Dock 图标类型 (https://macos-defaults.com/activity-monitor/icontype.html)
### 信息
- 显示主题字段 (https://macos-defaults.com/messages/show-subject-field.html)
### 其他
- 切换 Apple Intelligence (https://macos-defaults.com/misc/apple-intelligence.html)
- 帮助菜单位置 (https://macos-defaults.com/misc/devmode.html)
- 为所有 Dock 项目启用弹簧加载 (https://macos-defaults.com/misc/enable-spring-load-actions-on-all-items.html)
- 显示 Music 歌曲通知 (https://macos-defaults.com/misc/userwantsplaybacknotifications.html)
- 禁用应用程序隔离消息 (https://macos-defaults.com/misc/lsquarantine.html)
- 关闭“确认更改”弹出窗口 (https://macos-defaults.com/misc/nsclosealwaysconfirmschanges.html)
- 清除日历中最近使用的时区 (https://macos-defaults.com/misc/calendar-timezones.html)
- 退出应用程序时保持窗口 (https://macos-defaults.com/misc/nsquitalwayskeepwindows.html)
## 🤔 如何添加命令?(https://macos-defaults.com/#%F0%9F%A4%94-how-do-i-add-a-command)
如果您知道一个未列出的命令,请随时提出 GitHub issue (https://github.com/yannbertrand/macos-defaults/issues)。
您也可以通过创建 Pull Request 自行添加命令。请查看贡献指南 (https://macos-defaults.com/contributing.html)。
## ❤️ 我喜欢这个网站,如何构建一个类似的?(https://macos-defaults.com/#%E2%9D%A4%EF%B8%8F-i-like-this-website-how-can-i-build-the-same)
谢谢!我使用 VitePress (https://vitepress.dev/) 构建了它。
使用 Netlify (https://www.netlify.com/) 部署。
相似文章
立即体验 macOS 27 的绝佳功能之一
一款名为 Shortcuts Playground 的第三方工具允许你使用像 Claude Code 或 OpenAI 的 Codex 这样的 AI 代理,通过用自然语言描述你的需求来构建 Apple Shortcuts,这预览了 macOS 27 将推出的类似功能。
jaywcjlove/awesome-mac
一个精选的 macOS 软件 awesome 列表,涵盖原生应用、实用工具、开发者工具等,并包含赞助商提及和应用推荐。
@dabit3: 51秒上手指南:在Devin上设置macOS
一个简短的51秒教程,介绍如何为AI开发工具Devin设置macOS。
@akshay_pachaar:50+ 条 Claude Code 命令,一张速查表,按真实使用场景分组:1. 项目初始化与记忆 2. 上下文…
一份精选的 50+ 条 Claude Code CLI 命令速查表,按开发者实际使用场景分类整理。
MacArena:在在线macOS环境中对计算机使用代理进行基准测试
介绍了MacArena,这是一个包含50个应用程序中421项任务的基准测试,用于评估macOS上的计算机使用代理,强调现有基准测试可能无法捕捉macOS特有的挑战。