命令
netstat -nl | grep 5432netstat -nat | grep 5432
lsof如果看不到netstat显示的端口的进程。前面加sudo就能看到了。
sudo lsof -i :5432
查看文件
stat foo# 另一种查看时间方式mdls foo
sudo spctl --master-disable
Homebrew
国内源
cd "$(brew --repo)"git remote set-url origin https://mirrors.ustc.edu.cn/brew.gitgit remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.gitcd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.gitgit remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottlesexport HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
执行生效
# 更新Homebrew本身brew update
安装卸载
brew installbrew uninstall
更新
# 更新所有brew upgrade# 更新指定brew upgrade foo# 查看哪些可以更新brew outdated
清理
brew cleanupbrew cleanup foobrew cleanup -n
锁住不想更新的包,brew update会忽略它
brew pin foobrew unpin foo
brew info foobrew info
