macOS常用终端指令合集

1.显示"允许任何来源的应用"选项

打开终端,输入指令,然后回车(需要输入密码)

sudo spctl --master-disable

2.重建缓存

打开终端,输入指令后回车:

#!/bin/sh
sudo chmod -Rf 755 /S*/L*/E*
sudo chown -Rf 0:0 /S*/L*/E*
sudo chmod -Rf 755 /L*/E*
sudo chown -Rf 0:0 /L*/E*
sudo rm -Rf /S*/L*/PrelinkedKernels/*
sudo rm -Rf /S*/L*/Caches/com.apple.kext.caches/*
sudo touch -f /S*/L*/E*
sudo touch -f /L*/E*
sudo kextcache -Boot -U /

3.黑苹果 查询核芯显卡驱动所使用的platform-id

ioreg -l | grep -y platform-id

4.黑苹果查看声卡型号、注入ID、ConfigData

ioreg -l | grep ALC | grep HDAConfigDefault

5.笔记本开启接入电源提示音

开启:

defaults write com.apple.PowerChime ChimeOnAllHardware -bool true; open /System/Library/CoreServices/PowerChime.app &

关闭:

efaults write com.apple.PowerChime ChimeOnAllHardware -bool false; killall PowerChime

6.一键开启HiDPI

HiDPI黑白苹果都适用,白苹果主要用在外接显示屏时会用到。

sh -c "$(curl -fsSL https://html.sqlsec.com/hidpi.sh)"

7.去掉窗口截屏阴影

defaults write com.apple.screencapture disable-shadow -bool TRUE

如果是还原截屏阴影那就把最后的TRUE替换为FALSE

2.在复制下方指令粘贴到终端中后回车:

Killall SystemUIServer

8.Finder显示隐藏文件

第一行指令最后, true代表隐藏,false代表显示

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

9.在Finder标题栏显示完整路径

defaults write com.apple.finder _FXShowPosixPathInTitle -bool YES
killall Finder

开关谷歌浏览器黑暗模式

defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool YES
defaults write com.google.Chrome NSRequiresAquaSystemAppearance -bool NO

待补充。。。

打赏