记录一些 MacOS 中有用命令。
查看 cpu 信息
1
| sysctl -n machdep.cpu.brand_string
|
修改终端里显示 hostname
1
| sudo hostname -s <HOST_NAME>
|
修改终端
1 2
| defaults write com.apple.dock ResetLaunchPad -bool true killall Dock
|
显示日历和年历
调整启动台里每行和每列显示的数量
1 2 3 4 5 6
| defaults write com.apple.dock springboard-columns -int 6;
defaults write com.apple.dock springboard-rows -int 5; defaults write com.apple.dock ResetLaunchPad -bool TRUE; killall Dock;
|
去除 Dock 动画
1 2
| defaults write com.apple.dock autohide-time-modifier -float 0; killall Dock
|
修改截图路径
1 2
| defaults write com.apple.screencapture location <截图位置> killall SystemUIServer
|
修改截图格式
1 2 3
| defaults write/read com.apple.screencapture type jpg; killall SystemUIServer
|
防止 macOS 进入休眠状态
显示访达文件路径
1 2 3
| defaults write/read com.apple.finder _FXShowPosixPathInTitle -bool YES; killall Finder
|
Dock 栏添加空气墙
1 2 3 4
|
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'; Killall Dock
|
Finder 显隐隐藏文件
1 2 3 4 5 6
| defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder
defaults write com.apple.finder AppleShowAllFiles -bool false killall Finder
|
截屏窗口阴影
cmd + shift + 4,空格
截图的窗口会有阴影
1 2 3 4 5 6
| defaults write com.apple.screencapture disable-shadow -bool true killall SystemUIServer
defaults write com.apple.screencapture disable-shadow -bool false killall SystemUIServer
|