- [[BSD]], [[Linux]]
- [[Objective-C]], [[swift]]
- System infomation
brew install neofetch
- CPU infomation
sysctl -a | sort | grep cpu
sysctl -n hw.ncpu
sysctl -n hw.physicalcpu
- 清屏 Terminal
clear
(实际上仅是滚动光标至顶部) - 彻底清屏 Termimal
cmd + k
- 选中多个文件
command+option+i
查看总大小 - 查看 Bundle ID:
osascript -e 'id of app "SomeApp"'
mdls -name kMDItemCFBundleIdentifier -r AbsolutePathOfSomeApp.app
- 查看当前监听的端口列表:
netstat -AaLlnW
- Homebrew: 🍺 The missing package manager for macOS (or Linux)
- Homebrew Cask: 🍻 A CLI workflow for the administration of macOS applications distributed as binaries
- neofetch: Fast, highly customisable system info script
- tree 命令,终端展示你的目录树结构
- OS X 磁盘空间分析工具: ncdu
brew install ncdu
ncdu / --exclude /Volumes
du -hd1
以 human readable 格式,展示当前目录所有子目录大小- 注:与 linux 下不同,a 与 d 互斥
- eul: 🖥️ macOS status monitoring app written in SwiftUI.
- hidden A ultra-light MacOS utility that helps hide menu bar icons https://d.foundation/opensource
- ⭐Quick Look plugins List of useful Quick Look plugins for developers
- install all
brew install qlcolorcode qlstephen qlmarkdown quicklook-json qlimagesize suspicious-package apparency quicklookase qlvideo
- install more
brew install provisionql quicklookapk quicklook-pat webpquicklook syntax-highlight
- install all
- Go2Shell opens a terminal window to the current directory in Finder.
brew cask install go2shell
- OpenInTerminal Finder Toolbar app for macOS to open the current directory in Terminal, iTerm, Hyper or Alacritty.
- LICEcap simple animated screen capture tool for Windows and OS X
- IINA is the modern video player for macOS. https://iina.io
- Xcode 缓存及垃圾文件清理
- 删除旧设备支持
~/Library/Developer/Xcode/iOS DeviceSupport
- 删除旧模拟支持
~/Library/Application Support/iPhone Simulator
- 项目索引及日志
~/Library/Developer/Xcode/DerivedData
- 删除旧设备支持
- Source code of Telegram for macos on Swift 5.0 https://macos.telegram.org
- Source code of Telegram obj-c version of macos client, now is no longer supported.
- mackup Keep your application settings in sync (OS X/Linux)
- How to set a file or folder to be ignored
- If you’re running macOS 12.3 or earlier:
- Ignore it
xattr -w com.dropbox.ignored 1 '/Users/yourname/Dropbox (Personal)/YourFileName.pdf'
- Don't ignore
xattr -d com.dropbox.ignored '/Users/yourname/Dropbox (Personal)/YourFileName.pdf'
- Ignore it
- If you’re running macOS 12.5 or later and have the updated version of Dropbox for macOS on File Provider:
- Switch it
xattr -d 'com.apple.fileprovider.ignore#P' '/Users/yourname/Library/CloudStorage/Dropbox-Personal/YourFileName.pdf'
- Switch it
- If you’re running macOS 12.3 or earlier:
- How to identify the terminal from a script?
$TERM_PROGRAM
, iTerm sets it toiTerm.app
, and Terminal.app toApple_Terminal
.
- Mac的最大连接数限制和端口的相关参数的设置
- 让终端走代理的几种方法
- 网络编程 macOS 总是弹出防火墙链接确认
- macOS 删除 chrome 地址栏联想内容
- 按向下箭头键以突出显示相应内容,然后按 Shift + fn + Delete 键
- Mac关闭顽固的开机启动程序
- 使用登录项添加自启动项
设置 -> 用户与群组 -> 登录项
- 使用 Homebrew
brew services [run/start/stop/restart/../list/help]
- 使用 launchctl 工具
- 所在目录:
~/Library/LaunchAgents # 特定用户登录后以当前用户启动,第三方程序一般都放这里 /Library/LaunchAgents # 任一用户登录后以当前用户启动,管理员使用 /Library/LaunchDaemons # 系统装载时以root用户启动,管理员使用 /System/Library/LaunchAgents # 系统组件,任一用户登录后以当前用户启动 /System/Library/LaunchDaemons # 系统组件,系统装载时以root用户启动
launchctl list
查看当前所有自启动项launchctl load XXX
添加自启动项launchctl unload XXX
删除自启动项- for example
# 以下重启后无效 launchctl stop /Library/LaunchAgents/com.epson.esua.launcher.plist launchctl stop /Library/LaunchAgents/com.epson.eventmanager.agent.plist launchctl stop /Library/LaunchAgents/com.epson.scannermonitor.plist launchctl unload /Library/LaunchAgents/com.epson.esua.launcher.plist launchctl unload /Library/LaunchAgents/com.epson.eventmanager.agent.plist launchctl unload /Library/LaunchAgents/com.epson.scannermonitor.plist
- 修改 plist 文件,将 KeepAlive 和 RunAtLoad 等改为 false
- 所在目录:
- 使用登录项添加自启动项
- xargs 之类的 shell 命令,参数格式与 Linux 有些不一样,如何与 Linux 统一起来?
- 需要 GNU 系列工具
brew install coreutils gnu-sed
- 把 PATH 路径放到前面,确保使用的都是 brew 安装的 GNU 命令
- 需要 GNU 系列工具
- 重置 launchpad:
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
- 弹框无法关闭
Command + Option + Shift + Ecs
- MacBook Pro充不进电?
- macOS App debug
- awesome-mac Now we have become very big, Different from the original idea. Collect premium software in various categories. https://git.io/macx
- awesome-macOS A curated list of awesome applications, softwares, tools and shiny things for macOS.
- my-mac-os List of applications and tools that make my macOS experience even more amazing
- open-source-mac-os-apps Awesome list of open source applications for macOS.
- 程序员的macOS系列:精选 Mac App